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
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.
Is there anything wrong with vimeo\.com/(\d)+
? Do you need the http://www.
?
Be careful: The url scheme is
http://vimeo.com/[SEVERAL_FOLDERS(opt.)]/[VIDEO_NUMBER]
for example:
http://vimeo.com/channels/staffpicks/48237094
http://vimeo.com/48237094
As you can see, it depends from what page the user copies the link from.
It's Better to ask viemo guys about it because they know better and if they change anything they will reflect it in their apis
Live Example :
http://vimeo.com/api/oembed.json?url=http%3A//vimeo.com/76979871
API docs : http://developer.vimeo.com/apis/oembed
Answer inspired from this one https://stackoverflow.com/a/17156853/1545904
Vimeo have 4 different public video links
vimeo.com/[Video ID]
vimeo.com/channels/[Channel]/[Video ID]
vimeo.com/groups/[Group]/[Video ID]
player.vimeo.com/video/[Video ID]
/(http|https)?:\/\/(www\.|player\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|video\/|)(\d+)(?:|\/\?)/