PHP中正则函数preg_match匹配出现错误,应该是什么问题?
<?php$email='abc#foo.126.com';if(preg_match('^[a-zA-Z0-9_\-\.]+@[a-zA-Z0-9\-]+\.[a-zA...
<?php
$email = 'abc#foo.126.com';
if(preg_match('^[a-zA-Z0-9_\-\.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$', $email)){
echo '成功匹配';
}else{
echo '匹配失败';
}
?>
Warning: preg_match(): No ending delimiter '^' found in F:\wwwroot\labs\3.php on line 3
匹配失败 展开
$email = 'abc#foo.126.com';
if(preg_match('^[a-zA-Z0-9_\-\.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$', $email)){
echo '成功匹配';
}else{
echo '匹配失败';
}
?>
Warning: preg_match(): No ending delimiter '^' found in F:\wwwroot\labs\3.php on line 3
匹配失败 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询