Created
November 7, 2013 14:59
-
-
Save ifthenelse/7355999 to your computer and use it in GitHub Desktop.
Get Vimeo video ID based on video URL. works with these patterns: https://vimeo.com/11111111
http://vimeo.com/11111111
https://www.vimeo.com/11111111
http://www.vimeo.com/11111111
https://vimeo.com/channels/11111111
http://vimeo.com/channels/11111111
https://vimeo.com/groups/name/videos/11111111
http://vimeo.com/groups/name/videos/11111111
https…
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
var vimeoRegexp = /(?:https?\:)?\/\/(?:www\.|player\.)?vimeo.com\/(?:video\/|channels\/|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)/; | |
var vimeoVideoUrl = "//player.vimeo.com/video/2243632"; | |
var vimeoVideoArray = vimeoRegexp.regexp(vimeoVideoUrl); | |
var vimeoVideoID = vimeoVideoArray[3]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment