日期:2014-05-17 浏览次数:20539 次
<table cellpadding=0 cellspacing=0>
<tr>
<td width=68 height=52 bgcolor=white >
<table cellpadding=0 cellspacing=0 width="100%">
<tr>
<td>
<p>...</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p >手持量筒量取一定体积的液体</p>
<p >用托盘天平称量5.65g食盐</p>
<table border=1 cellspacing=0 cellpadding=0
>
<tr >
<td width=197 valign=top >
<p>A</p>
</td>
<td width=262 valign=top >
<p>B</p>
</td>
</tr>
</table>
<table cellpadding=0 cellspacing=0>
<tr>
<td width=68 height=52 bgcolor=white >
<table cellpadding=0 cellspacing=0 width="100%">
<tr>
<td> ...
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border=1 cellspacing=0 cellpadding=0
>
<tr >
<td width=197 valign=top >
<p>...</p>
</td>
<td width=262 valign=top >
<p>...</p>
</td>
</tr>
</table>
Regex ex = new Regex(strRx, RegexOptions.Singleline);
MatchCollection matchCollection = ex.Matches(strInput);
//我的写法:
//结果是匹配了所有内容..
//<table[^>]*>[\s\S]*(((?'Open'<table[^>]*>)[\s\S]*)+((?'-Open'</table>)[\s\S]*)+)*(?(Open)(?!))</table>