用下面的代碼的preg_match - 正則表達式錯誤
$regex = "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*"
."@[a-z0-9-]+(\.[a-z0-9-]{1,})*"
."\.([a-z]{2,}){1}$";
if(!preg_match($regex,$subemail)){
$form->setError($field, "* Email invalid");
}
$subemail = stripslashes($subemail);
}
我收到以下錯誤
Warning: preg_match() [function.preg-match]: No ending delimiter '^' found
任何幫助將不勝感激。
即使你會解決您的分隔符的模式將無法在**很多** emailaddresses的:https://emailtester.pieterhordijk.com/test-pattern/NTE – PeeHaa
http://php.net/manual/en/function.filter-var.php – elclanrs