我想运行以下命令regex
,PHP
但遇到以下错误:
preg_match()[function.preg-match]:无结尾定界符'^'
我的代码:
if (preg_match("^(?!.*(l_name|f_name|m_name)).*$", $str)) {
// Do sth
}
有任何想法吗?
尝试
if (preg_match("/^(?!.*(l_name|f_name|m_name)).*$/", $str)) {
// Do sth ^ ^
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句