I want to run the following regex
in PHP
but I faced with the error that says:
preg_match() [function.preg-match]: No ending delimiter '^'
My Code:
if (preg_match("^(?!.*(l_name|f_name|m_name)).*$", $str)) {
// Do sth
}
Any ideas?
I want to run the following regex
in PHP
but I faced with the error that says:
preg_match() [function.preg-match]: No ending delimiter '^'
My Code:
if (preg_match("^(?!.*(l_name|f_name|m_name)).*$", $str)) {
// Do sth
}
Any ideas?
Try
if (preg_match("/^(?!.*(l_name|f_name|m_name)).*$/", $str)) {
// Do sth ^ ^
}