Skip to content Skip to sidebar Skip to footer

Vimeo Video Link Regex

Anybody got the regex for vimeo video links to extract them from a pragraph for use in php? Can't seem to find a proper one for the latest vimeo url scheme

Solution 1:

Vimeo have 4 different public video links

  1. Video ID vimeo.com/[Video ID]
  2. Channels vimeo.com/channels/[Channel]/[Video ID]
  3. Groups vimeo.com/groups/[Group]/[Video ID]
  4. Player player.vimeo.com/video/[Video ID]

/(http|https)?:\/\/(www\.|player\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|video\/|)(\d+)(?:|\/\?)/

Solution 2:

As far as I can tell, the scheme is just http://vimeo.com/A_NUMBER, so try http://(www\.)?vimeo\.com/(\d+). If you don't need links to be prefixed by http://, you can leave off the whole http://(www\.) bit.

Solution 3:

Be careful: The url scheme is

http://vimeo.com/[SEVERAL_FOLDERS(opt.)]/[VIDEO_NUMBER]

for example:

http://vimeo.com/channels/staffpicks/48237094http://vimeo.com/48237094

As you can see, it depends from what page the user copies the link from.

Solution 4:

This one covers all possible Vimeo Video URL Schemes:

(?:http|https)?:?\/?\/?(?:www\.)?(?:player\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\/videos\/|video\/|)(\d+)(?:|\/\?)
vimeo.com/123456789
vimeo.com/channels/mychannel/123456789
vimeo.com/groups/shortfilms/videos/123456789
player.vimeo.com/video/123456789
http://vimeo.com/123456789
https://vimeo.com/channels/mychannel/123456789
https://vimeo.com/groups/shortfilms/videos/123456789
https://www.player.vimeo.com/video/123456789

Test here: https://regexr.com/68gk3

Solution 5:

Is there anything wrong with vimeo\.com/(\d)+? Do you need the http://www.?

Post a Comment for "Vimeo Video Link Regex"