Following are the possible inputs from users.
<embed src="http://player.youku.com/player.php/sid/XMTQxNzMxMjI0/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" allowFullscreen="true" type="application/x-shockwave-flash"></embed>
http://player.youku.com/player.php/sid/XMTQxNzMxMjI0/v.swf
http://v.youku.com/v_show/id_XMTQxNzMxMjI0.html
I need a regular expression to extract video ID from the provided input.
here’s how i would do it. id in first capture group.
i understand now that you use php as application language, which changes things a bit. you have to start and end the regular expression with a formality character of your own choice. for this regular expression i’d use the hash character, since it’s not used anywhere in the regular expression: