Return to Snippet

Revision: 62239
at February 11, 2013 07:31 by slimITTN

Initial Code
var regExp = /^.*(\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#\&\?]*).*/;
var match = url.match(regExp);
if (match&&match[2].length==11){
    return match[2];

Initial URL

Initial Description
This snippets show how to extract the video id of a youtube video from its URL

Initial Title
Youtube ID from URL

Initial Tags
url, video

Initial Language