I am currently using regex code to separate YT video ids. The reason I am using regex is that yt video URLs vary in many formats. I have built a regex that will pretty much detect the ID of almost all YT url formats except the one below. I have tried modifying it but no luck. Is there a way to have Regex strip the id from the URL below?
http://www.youtube.com/watch?feature=v-feature&v=317a815FLWQ
Regex:
('~https?://(?:[0-9A-Z-]+\.)?(?:youtu\.be/| youtube\.com\S*[^\w\-\s])([\w\-]{11})(?=[^\w\-]|$)(?![?=&+%\w]*(?:[\'"][^<>]*>| </a>))[?=&+%\w]*~ix','http://www.youtube.com/watch?v=$1',$url);