Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在其中运行以下内容regex,PHP但遇到了以下错误:
regex
PHP
preg_match() [function.preg-match]:没有结束分隔符'^'
我的代码:
if (preg_match("^(?!.*(l_name|f_name|m_name)).*$", $str)) { // Do sth }
有任何想法吗?
Try
if (preg_match("/^(?!.*(l_name|f_name|m_name)).*$/", $str)) { // Do sth ^ ^ }