showing results for - "vaidate youtube url"
Angelo
04 May 2018
1function matchYoutubeUrl(url) {
2    var p = /^(?:https?:\/\/)?(?:m\.|www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
3    if(url.match(p)){
4        return url.match(p)[1];
5    }
6    return false;
7}