求一正则表达式,婚配一个限定的id
求一正则表达式,匹配一个限定的idtable idforum_list cellspacing0 stylewidth:760px匹配这个
求一正则表达式,匹配一个限定的id
<table id="forum_list" cellspacing="0" style="width:760px;"> 匹配这个id!
[最优解释]
$s='你的串';
preg_match('/<table id="forum_list"[^>]*>(.*?)<\/table>/s',$s,$m);
echo $m[1];
[其他解释]
/ id="([^"]*)"/
[其他解释]
匹配forum_list这个固定ID
[其他解释]匹配forum_list这个固定ID 以及下面的所有内容!
[其他解释]那个id看上去像discuz的
[其他解释]如果是匹配大堆html内容,最好把内容装载进dom,用dom的方式处理dom