Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save waitingallday/e3b3e86c60c861a78d3a35d1e2e5a4e1 to your computer and use it in GitHub Desktop.
Save waitingallday/e3b3e86c60c861a78d3a35d1e2e5a4e1 to your computer and use it in GitHub Desktop.
regex for youtube URL, extracts videoid into named group
(?:[youtbe.com\/wahd\?])(?:\w+=[\w+,.-]+\&)*(?:v=)?(?<videoid>[a-zA-Z0-9\-\_]{6,60})(?:\&\w+=[\w+,.-]+)*$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment