請問大神,問題在哪
<?php $subject = "my email is spark@imooc.com"; $pattern='/\s(\w+)@(\w+)\.(com|cn)/'; preg_match($pattern,$subject,$matches); print_r($matches[0]); //在這里補(bǔ)充代碼,實(shí)現(xiàn)正則匹配,并輸出郵箱地址 $subject = "my email is spark@imooc.com";
<?php $subject = "my email is spark@imooc.com"; $pattern='/\s(\w+)@(\w+)\.(com|cn)/'; preg_match($pattern,$subject,$matches); print_r($matches[0]); //在這里補(bǔ)充代碼,實(shí)現(xiàn)正則匹配,并輸出郵箱地址 $subject = "my email is spark@imooc.com";
2015-04-12
舉報(bào)
2015-04-14
這是對的,匹配出的就是郵箱地址!