正则匹配,求帮忙
<html>
<body>
<div class="rscl"></div>
<div class="listNews">
<ul class="iconBoxT14">
<ul class="iconBoxT14">
<ul class="iconBoxT14">
<ul class="iconBoxT14">
<ul class="iconBoxT14">
<ul class="iconBoxT14">
<ul class="iconBoxT14">
<ul class="iconBoxT14">
<ul class="iconBoxT14">
</div>
</body>
</html>
-------------------------------------------------
我要匹配上面html代码中 <div class="listNews">之后 第一个</div> 之中的内容 正则该怎么写喃
也就是匹配出如下内容:
---------------------------------------------------
<ul class="iconBoxT14">
<ul class="iconBoxT14">
<ul class="iconBoxT14">
<ul class="iconBoxT14">
<ul class="iconBoxT14">
<ul class="iconBoxT14">
<ul class="iconBoxT14">
<ul class="iconBoxT14">
<ul class="iconBoxT14">
[解决办法]
/<div\s+class=\"listNews\">(.*)<\/div>/isU 用这个试下
$strHtml = <<<str <html> <body> <div class="rscl"></div> <div class="listNews"> <ul class="iconBoxT14"> <ul class="iconBoxT14"> <ul class="iconBoxT14"> <ul class="iconBoxT14"> <ul class="iconBoxT14"> <ul class="iconBoxT14"> <ul class="iconBoxT14"> <ul class="iconBoxT14"> <ul class="iconBoxT14"> </div> <div>3333</div> </body> </html>str;preg_match("/<div\s+class=\"listNews\">(.*)<\/div>/isU",$strHtml,$match);echo '<pre>';var_dump($match);