我有这样的代码:分隔符不能是字母,数字或反斜线和的preg_match
$string1 = "My name is 'Kate' and im fine";
$pattern = "My name is '(.*)' and im fine";
preg_match($pattern , $string1, $matches);
echo $matches[1];
和IM运行,当它返回此错误:
Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash
作为一个说明可能会有所帮助别人,如果你是通过你所有的参数'的preg_match()'作为变量,确保你不会在无意中混入了变量的顺序函数调用,因为这几乎肯定会导致出现相同的错误。 – bluebinary