Skip to content

Instantly share code, notes, and snippets.

@hcarvalhoalves
Created August 30, 2012 00:19
Show Gist options
  • 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