如何使用正则表达式从嵌入中获取 youtube ID,即使它是旧格式或 ifarme
例子
<iframe width="560" height="315" src="http://www.youtube.com/embed/ghc8cYOA1Vo" frameborder="0" allowfullscreen></iframe>
或者
<object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/ghc8cYOA1Vo?hl=en_US&version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ghc8cYOA1Vo?hl=en_US&version=3" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>
请指教,