Skip to content

Instantly share code, notes, and snippets.

@jimmylatreille
Last active May 16, 2016 09:43
Show Gist options
  • Save jimmylatreille/8676784 to your computer and use it in GitHub Desktop.
Save jimmylatreille/8676784 to your computer and use it in GitHub Desktop.
Regex to validate youtube, Vimeo & Dailymotion in the same input
/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$|^(?:https?:\/\/)?(?:www\.)?dailymotion.com\/(video|hub)+(\/([^_]+))?[^#]*(‪#‎video‬=([^_&]+))?$|^(?:https?:\/\/)?(?:www\.)?vimeo.com\/([0-9]+)$/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment