Last active
October 30, 2018 12:49
-
-
Save quantizor/7451443 to your computer and use it in GitHub Desktop.
Javascript regex to extract the ID out of YouTube, Vimeo and Instagram video URLs.
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
// Interactive breakdown at: https://www.debuggex.com/r/6zmlYhT6GVcEn-rh | |
var re = /^.*?(?:youtube\.com\/(?:watch\?v=|embed)/?|\/vimeo\.com\/|player\.vimeo\.com\/video\/|instagram\.com\/p\/)(.*?)\/?$/; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Doesn't seem to work for me, getting this error
Unexpected token |