正則表達(dá)式
<?php
$subject = "my email is spark@imooc.com";
//在這里補(bǔ)充代碼,實(shí)現(xiàn)正則匹配,并輸出郵箱地址
$P='/my\s+email\s+is\s+(\w+@\w+\.\w+)/';(\s不是表示空字符嗎啊換這種寫法也是錯(cuò)的啊'/my email is (【\w+】@\w+\.\w+)/')為什么啊
preg_match($p, $subject, $matches);
echo $matches[1];
為什么會(huì)報(bào)錯(cuò)???Notice: Undefined variable: p in /26/562/J3c4/index.php on line 5
Warning: preg_match(): Empty regular expression in /26/562/J3c4/index.php on line 5
2017-01-05
這里區(qū)分了大小寫
2017-01-05
Undefined variable: p