Skip to content

Instantly share code, notes, and snippets.

@FinalAngel
Created February 21, 2012 14:45
Show Gist options
  • Save FinalAngel/1876898 to your computer and use it in GitHub Desktop.
Save FinalAngel/1876898 to your computer and use it in GitHub Desktop.

Revisions

  1. Angelo Dini renamed this gist Feb 21, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. Angelo Dini revised this gist Feb 21, 2012. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions get_youtube_id_regex
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,4 @@
    <script>
    url.test(/(youtu(?:\.be|be\.com)\/(?:.*v(?:\/|=)|(?:.*\/)?)([\w'-]+))/i);
    </script>
    /(youtu(?:\.be|be\.com)\/(?:.*v(?:\/|=)|(?:.*\/)?)([\w'-]+))/i

    Tested examples:
    http://www.youtube.com/user/Scobleizer#p/u/1/1p3vcRhsYGo
  3. Angelo Dini revised this gist Feb 21, 2012. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions get_youtube_id_regex
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    <script>
    url.test(/(youtu(?:\.be|be\.com)\/(?:.*v(?:\/|=)|(?:.*\/)?)([\w'-]+))/i);
    </script>

    Tested examples:
    http://www.youtube.com/user/Scobleizer#p/u/1/1p3vcRhsYGo
  4. Angelo Dini revised this gist Feb 21, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion get_youtube_id_regex
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    /(youtu(?:\.be|be\.com)\/(?:.*v(?:\/|=)|(?:.*\/)?)([\w'-]+))/i
    url.test(/(youtu(?:\.be|be\.com)\/(?:.*v(?:\/|=)|(?:.*\/)?)([\w'-]+))/i);

    Tested examples:
    http://www.youtube.com/user/Scobleizer#p/u/1/1p3vcRhsYGo
  5. Angelo Dini created this gist Feb 21, 2012.
    17 changes: 17 additions & 0 deletions get_youtube_id_regex
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    /(youtu(?:\.be|be\.com)\/(?:.*v(?:\/|=)|(?:.*\/)?)([\w'-]+))/i

    Tested examples:
    http://www.youtube.com/user/Scobleizer#p/u/1/1p3vcRhsYGo
    http://www.youtube.com/watch?v=cKZDdG9FTKY&feature=channel
    http://www.youtube.com/watch?v=yZ-K7nCVnBI&playnext_from=TL&videos=osPknwzXEas&feature=sub
    http://www.youtube.com/ytscreeningroom?v=NRHVzbJVx8I
    http://www.youtube.com/user/SilkRoadTheatre#p/a/u/2/6dwqZw0j_jY
    http://youtu.be/6dwqZw0j_jY
    http://www.youtube.com/watch?v=6dwqZw0j_jY&feature=youtu.be
    http://youtu.be/afa-5HQHiAs
    http://www.youtube.com/user/Scobleizer#p/u/1/1p3vcRhsYGo?rel=0
    http://www.youtube.com/watch?v=cKZDdG9FTKY&feature=channel
    http://www.youtube.com/watch?v=yZ-K7nCVnBI&playnext_from=TL&videos=osPknwzXEas&feature=sub
    http://www.youtube.com/ytscreeningroom?v=NRHVzbJVx8I
    http://www.youtube.com/embed/nas1rJpm7wY?rel=0
    http://www.youtube.com/watch?v=peFZbP64dsU