真心求教正则表达式
谁帮我把以下代码中,用正则表达式提取以下3个数据呢?
第一:alt="Mexico" 中的 Mexico
第二:
7732078
中的 7732078
第三:
A 14
中的 A 14
7732078A 14
7528398A 15
谢谢了。
------解决方案--------------------
PHP code
7732078
A 14
7528398
A 15
HTML;
preg_match_all('/alt="(.*?)"|class="imo">(.*?)(.*?)',$str,$matchs);
print_r($matchs);
------解决方案--------------------
$re1 = '/alt="[a-zA-Z]*[^"]/i';
$re2 = '/\d*[^\$re3 = '/[a-zA-Z0-9 ]*[^\$match ='';
preg_match_all($re1, $str, $match);
echo '';
print_r($match);
第一个$re1还有点问题,你在想一想吧
