Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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