Skip to content

Instantly share code, notes, and snippets.

@Ariex
Last active August 29, 2015 14:26
Show Gist options
  • Save Ariex/e2dbc4818d46fdfde936 to your computer and use it in GitHub Desktop.
Save Ariex/e2dbc4818d46fdfde936 to your computer and use it in GitHub Desktop.
Useful Regex

matches vimeo video Id

^https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)$

matches youtube video Id

(from http://stackoverflow.com/a/26445466/903505)

(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+(?:&|&);v=))((?:\w|-|_){11})(?:(?:\?|&|&)index=((?:\d){1,3}))?(?:(?:\?|&|&)list=((?:\w|-|_){24}))?(?:\S+)?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment