提取 html 中 table 的正则表达式

求一个 提取 html 中 table 的正则表达式
html内容:
<table   id   =   "1 ">
<tr>
<td>
<table   id   =   "2 ">
<tr>
<td   >
abc
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table   id   =   "3 ">
<tr>
<td   >
def
</td>
</tr>
</table>
</td>
</tr>
</table>

目标:用正则表达式提取
table2,和table3


谢谢了!


------解决方案--------------------
因为一些个人原因,最近不想答正则问题了,呵呵,不过楼主既然提到我,那就回下吧


你要的是最内层的table吗,这样试下,看看是不是你要的结果吧,如果不是,再说明下,或是给出你要的结果

Dim yourStr As String = ...............
Dim mc As MatchCollection = Regex.Matches(yourStr, " <table[^> ]*> ( <(?!/?table)[^> ]*> |[^ <> ]*)* </table> ", RegexOptions.IgnoreCase)
For Each m As Match In mc
RichTextBox2.Text += m.Value + vbCrLf
Next
------解决方案--------------------
不知道你为什么要用正则!JS里面处理DOM元素的功能不够用吗?
------解决方案--------------------
<table[^> ]*> ( <(?!/?table)[^> ]*> |[^ <> ]*)* </table>
------解决方案--------------------
首先用 webrequest 得到 一个网页的代码,在用正则分析网页中
table 的树状结构。
比如

table1 -
|
table2
|
table3 -
|
table4......

这样的功能 JS 可以实现吗?
------------------------------------
看你提取这些内容有什么用!!功能当然都能实现啊!!
不过如果你只是取table里面的内容,那就用正则提取吧!