首页 >后端开发 >php教程 >正则表达式判断email和URL, 帮忙看看有没有要补充的._PHP教程

正则表达式判断email和URL, 帮忙看看有没有要补充的._PHP教程

WBOY
WBOY原创
2016-07-13 10:59:41964浏览


echo 'a:'.htmlspecialchars($a);
echo '
a1:';
$a1 = eregi_replace('(^[_.][:alnum:]-]+@([[:alnum:]][[:alnum:]-]*.)+[[:alpha:]]{2,3}$)',' 1 ', $a) ;
echo htmlspecialchars($a1);
echo "
a1:$a1";
echo '
a2:';
$a2 = eregi_replace('([[:alnum:]]+://([[:alnum:]][[:alnum:]-]*.)+[[:alpha:]]{2,3}([#?/][^#?/][:space:]][^[:space:]]*)?)',
        '1', $a);
echo htmlspecialchars($a2);
echo "
a2:$a2";
// eregi('^[_.][:alnum:]-]+@([[:alnum:]][[:alnum:]-]*.)+[[:alpha:]]{2,3}$',$a) or die("not a email");
?>




    

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/631878.htmlTechArticlebodyonload=f.a.select(); ?php echo 'a:'.htmlspecialchars($a); echo 'bra1:'; $a1 = eregi_replace('(^[_.][:alnum:]-]+@([[:alnum:]][[:alnum:]-]*.)+[[:alpha:]]{2,3}$)',' a href=mailto:1...
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn