Possible Duplicate:
Regex to parse youtube yid
your probably thinking not another one, but here i have a jquery regex which i find it works fine on the majority of urls accpet one example at bottom:
http://www.youtube.com/watch?v=0zM3nApSvMg&feature=feedrec_grec_index
http://www.youtube.com/user/IngridMichaelsonVEVO#p/a/u/1/QdK8U-VIH_o
http://www.youtube.com/v/0zM3nApSvMg?fs=1&hl=en_US&rel=0
http://www.youtube.com/watch?v=0zM3nApSvMg#t=0m10s
http://www.youtube.com/embed/0zM3nApSvMg?rel=0
http://www.youtube.com/watch?v=0zM3nApSvMg
http://youtu.be/0zM3nApSvMg
the regex
/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/
but this cannot extract the id from the url below (in this example the id is pa14VNsdSYM)
http://www.youtube.com/watch?feature=endscreen&NR=1&v=pa14VNsdSYM
how can using the regex can i extract the id from urls such as the one above.