好了,所以可以说我需要一个部分链接:http://www.dailymotion.com/video/xnstwx_bmw-eco-pro-race_auto
无法获得的preg_match返回所需的数据
我需要得到
[0] => xnstwx
[1] => bmw-eco-pro-race_auto
和我正在尝试:preg_match('/video\/([A-Za-z0-9]+)_/i', $video['url'], $match);
我得到:
[0] => video/xnstwx_
[1] => xnstwx
比我尝试它:preg_match('/video\/([A-Za-z0-9]+)_/([A-Za-z0-9-_]+)', $video['url'], $match);
,我想你已经知道这是错误的。
我一直逃避正则表达式无缘无故,现在我试图学习使用正则表达式作弊表,但现在我有点卡住:)。
感谢您的解决方案 – Alex