【发布时间】:2015-03-14 04:17:04
【问题描述】:
我有一个这样的字符串:
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, https://www.youtube.com/watch?v=7TL02DA5MZM when an unknown printer took a galley of type and scrambled it to make a type
这就是我所拥有的:
preg_match("(?:http://)?(?:www.)?(?:youtube.com|youtu.be)/(?:watch\?)?([^\s]+?)", $content, $m);
var_dump( $m );
并希望从中提取 youtube 链接。 视频ID也可以。
不胜感激!
【问题讨论】:
标签: php regex preg-match