1// true when ID is found, false otherwise.
2//Extracts youtube ID
3<script type="text/javascript">
4function youtube_parser(url){
5 var regExp = /^https?\:\/\/(?:www\.youtube(?:\-nocookie)?\.com\/|m\.youtube\.com\/|youtube\.com\/)?(?:ytscreeningroom\?vi?=|youtu\.be\/|vi?\/|user\/.+\/u\/\w{1,2}\/|embed\/|watch\?(?:.*\&)?vi?=|\&vi?=|\?(?:.*\&)?vi?=)([^#\&\?\n\/<>"']*)/i;
6 var match = url.match(regExp);
7 return (match && match[1].length==11)? match[1] : false;
8}
9</script>