search

Home  >  Q&A  >  body text

上面正则表达式中preg_match这个是什么意思?

<?php
	header("Content-type: text/html; charset=utf-8");//设置编码
	$zz = '/\w+@([a-zA-Z0-9-]+.){1,2}(com|cn|org|gov.cn|net|edu.cn)/';
	$string1 = "k53981@qq.com";
	if (preg_match($zz, $string1, $matches)) {
	    echo '匹配到了,结果为:';
	    var_dump($matches);
	} else {
	    echo '没有匹配到';
	}
?>


看透不说透看透不说透2907 days ago1288

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-09-30 22:45:58

    What does preg_match mean in the regular expression above? -PHP Chinese website Q&A-What does preg_match mean in the above regular expression? -PHP Chinese website Q&A

    Please watch and learn.

    reply
    0
  • 迷茫

    迷茫2016-12-17 14:58:31

    执行一个正则表达式匹配

    reply
    0
  • Cancelreply