首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

最里層正則匹配,该如何处理

2012-01-26 
最里層正則匹配tabletabletabletrtd a /td/tr/table/table/table求最里層正則匹配的

最里層正則匹配
<table>
  <table>
    <table>
      <tr> <td> a </td> </tr>
    </table>
  </table>
</table>


求最里層正則匹配的寫法
如上所示,怎樣得到
    <table>
      <tr> <td> a </td> </tr>
    </table>

即最里層 <table> </table> 內容


[解决办法]
<table(\s+[^> ]+)?> (?![\s\S]* <table(\s+[^> ]+)?> )[\s\S]*? </table>

热点排行