Vimeo video link regex

Has anyone got a regex for vimeo video links to extract them from the paragraph for use in php? Cannot seem to find vimeo url suitable for last scheme

+4
source share
4 answers

As far as I can tell, the scheme is just http://vimeo.com/A_NUMBER , so try http://(www\.)?vimeo\.com/(\d+) . If you do not need links for the http:// prefix, you can leave the entire bit http://(www\.) .

+3
source

Be careful: URL scheme

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

eg:

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

As you can see, it depends on which page the user copies the link to.

+3
source

Is there something wrong with vimeo\.com/(\d)+ ? You need http://www. ?

0
source

It’s better to ask viemo about it because they know better, and if they change something, 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 by this fooobar.com/questions/26428 / ...

0
source

Source: https://habr.com/ru/post/1339883/


All Articles