标签:style blog color sp div log bs as nbsp
1、匹配嵌套DIV
$str = ‘<div id="test">‘. ‘<div>1‘. ‘<div>1-1‘. ‘<div>1-1-1‘. ‘</div>‘. ‘</div>‘. ‘</div>‘. ‘<div>2</div>‘. ‘<span>3</span>‘. ‘<div>4</div>‘. ‘</div>‘; $regex = "/<div.*?id=\"test\".*?>(<.*?>.*?<\/.*?>){0,10}<\/div>/is"; preg_match ( $regex, $str, $m ); print_r($m);
标签:style blog color sp div log bs as nbsp
原文地址:http://www.cnblogs.com/whoamme/p/4158015.html