Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 565
Hirvesh Avatar asked Feb 15 '11 19:02

Hirvesh


People also ask

How do I copy the link from a Vimeo video?

Copying a Vimeo video linkSelect the URL for the Vimeo video in the address bar of your web browser, right-click and select Copy.

How do I link to a specific time in Vimeo?

Linking to a specific part of a video Just add #t= followed by the timecode of where you'd like playback to begin. By adding #t=3m13s to the end of the URL, the link automatically triggers playback to begin three minutes and thirteen seconds into the video.


2 Answers

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+)(?:|\/\?)/

like image 161
TheCrazyProfessor Avatar answered Sep 19 '22 07:09

TheCrazyProfessor


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.

like image 40
Lucas Jones Avatar answered Sep 22 '22 07:09

Lucas Jones