日期:2014-05-16  浏览次数:20685 次

php正则表达式提取html标签的问题

<tr>
    <td  Height="30"> ·<a class="index_libiao" href="http://www.zh818.com/html/2014/033/7155319.aspx
" title="3月14日上海钢材市场价格汇总" target="_blank">
             <font color="#0000FF"> 3月14日上海钢材市场价格汇总</font>
        </a></td>
    <td align="Right"><span class="biaotiriqi"> 3月14日</span></td>
  </tr>
  <tr>
    <td  Height="30"> ·<a class="index_libiao" href="http://www.zh818.com/html/2014/033/7155318.aspx
" title="3月14日北京钢材市场价格汇总" target="_blank">
             <font color="#0000FF"> 3月14日北京钢材市场价格汇总</font>
        </a></td>
    <td align="Right"><span class="biaotiriqi"> 3月14日</span></td>
  </tr>
  <tr>
    <td  Height="30"> ·<a class="index_libiao" href="http://www.zh818.com/html/2014/033/7155317.aspx
" title="3月14日天津钢材市场价格汇总" target="_blank">
             <font color="#0000FF"> 3月14日天津钢材市场价格汇总</font>
        </a></td>
    <td align="Right"><span class="biaotiriqi"> 3月14日</span></td>
  </tr>
  <tr>
    <td  Height="30"> ·<a class="index_libiao" href="http://www.zh818.com/html/2014/033/7155316.aspx
" title="3月14日重庆钢材市场价格汇总" target="_blank">
             <font color="#0000FF"> 3月14日重庆钢材市场价格汇总</font>
        </a></td>
    <td align="Right"><span class="biaotiriqi"> 3月14日</span></td>
  </tr>
  <tr>
    <td  Height="30"> ·<a class="index_libiao" href="http://www.zh818.com/html/2014/033/7155315.aspx
" title="3月14日广州钢材市场价格汇总" target="_blank">
             <font color="#0000FF"> 3月14日广州钢材市场价格汇总</font>
        </a></td>


我想获取所有<td  Height="30">×××</td>的标签中间的内容,应该怎么写正则表达式呢
------解决方案--------------------

preg_match_all("/<td\s+Height=\"30\">(.*)<\/td>/iUs", $str, $output);
print_r($output);