Created
February 18, 2019 21:01
-
-
Save ohmika/fb7211a9972bf099944e2de8eeb1af42 to your computer and use it in GitHub Desktop.
Use this regex to get the video ID of a YouTube URL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(?<=(?:v|i)=)[a-zA-Z0-9-]+(?=&)|(?<=(?:v|i)\/)[^&\n]+|(?<=embed\/)[^"&\n]+|(?<=(?:v|i)=)[^&\n]+|(?<=youtu.be\/)[^&\n]+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment