Skip to content

Instantly share code, notes, and snippets.

@zerostyle
Created March 12, 2013 13:01
Show Gist options
  • Save zerostyle/5142696 to your computer and use it in GitHub Desktop.
Save zerostyle/5142696 to your computer and use it in GitHub Desktop.
Get Youtube ID from URL.
var videoURL = 'http://www.youtube.com/watch?v=jkWWJ9W5300';
var videoID = videoURL.replace(/.*youtube.*watch.*v=([a-zA-Z0-9-_]+).*/,'$1');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment