Nodejs Youtube URL Parse parseYoutubeId(url)

Here you can find the source of parseYoutubeId(url)

Method Source Code

function parseYoutubeId(url){
    var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
    var match = url.match(regExp);
    if (match&&match[7].length==11){
        return match[7];
    }else{// w w w .  j  a  v  a  2  s  .co  m
        return null;
    }
}