Old Spice Pro-Strength Commercial - Neil Patrick Harris

By: hambone224

191   7   120815

Uploaded on 07/25/2008

Another new commercial for Old Spice with Neil Patrick Harris.

Comments (3):

By anonymous    2018-07-02

Hello everyone I found this reg code to detect youtube link

      var array = [];
      var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*$/;
        var urls = 'First link https://www.youtube.com/embed/0zM3nApSvMg?rel=0 Second Link https://www.youtube.com/watch?v=0zM3nApSvMg'

        var match = urls.match(regExp);
    
    array = match[2];
alert(array)

But It doesn't handle multi links

I tried this but it doesn't work

https://regexr.com/3dnqv Thank you

Original Thread

By anonymous    2017-09-20

I made an enhancement to Regex provided by "jeffreypriebe" because he needed a kind of YouTube URL is the URL of the videos when they are looking through a channel.

Well no but this is the function that I have armed.

<script type="text/javascript">
function youtube_parser(url){
    var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
    var match = url.match(regExp);
    return (match&&match[7].length==11)? match[7] : false;
}
</script>

These are the types of URLs supported

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&amp;hl=en_US&amp;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

y Can be found in http://lasnv.net/foro/839/Javascript_parsear_URL_de_YouTube (Deadline)

Original Thread

Submit Your Video

If you have some great dev videos to share, please fill out this form.