Vimeo video link regex

旧街凉风 提交于 2019-12-10 16:16:21

问题


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


回答1:


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.




回答2:


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.




回答3:


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




回答4:


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




回答5:


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



来源:https://stackoverflow.com/questions/5008609/vimeo-video-link-regex

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!