Skip to content

Instantly share code, notes, and snippets.

@hcarvalhoalves
Created August 30, 2012 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hcarvalhoalves/3520875 to your computer and use it in GitHub Desktop.
Save hcarvalhoalves/3520875 to your computer and use it in GitHub Desktop.
Regex to extract YouTube video ids
import re
YOUTUBE_REGEX = re.compile(r'"http://.+?(/v/|/watch\\?v=)(?P<videoId>[A-Za-z0-9_-]{11}).+?"')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment