php警告没有找到结束分隔符'/'

时间:2013-06-19 09:20:38

标签: php preg-match warnings delimiter

我的代码如下所示

preg_match_all("/url=http.+?signature.+?\\/", $videosource , $videos);

,输出结果为:

Warning: preg_match() [function.preg-match]: No ending delimiter '/' found in /...

3 个答案:

答案 0 :(得分:0)

你正在逃避最后的/。试试preg_match_all("/url=http.+?signature.+?\\//", $videosource , $videos);

答案 1 :(得分:0)

您可以使用/

,而不是使用#~作为分隔符
preg_match_all("~url=http.+?signature.+?\\/~", $videosource , $videos);

答案 2 :(得分:0)

我假设你想在最后匹配一个字符串和反斜杠\而不是为了逃避最后的正斜杠/。尝试在末尾匹配一些长度为0的字符,以避免转义最后一个分隔符,例如:

preg_match_all("/url=http.+?signature.+?\\.{0}/", $videosource , $videos);