Home  >  Article  >  Backend Development  >  请问一个正则有关问题这么写问什么匹配不对

请问一个正则有关问题这么写问什么匹配不对

WBOY
WBOYOriginal
2016-06-13 12:40:25852browse

请教一个正则问题这么写问什么匹配不对

<br />
<?php<br />
    $str = file_get_contents("http://mil.news.sina.com.cn");<br />
	// 军情热点<br />
    $reg = '#【军情热点】.*<a.*href="(.*).*>(.*)</a>"#iUs';<br />
	preg_match_all($reg,$str,$m);<br />
	echo "<pre class="brush:php;toolbar:false">";<br />
	print_r($m);<br />
?><br />


请教一下  匹配一下链接和标题 这么写为什么不对

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn