日期:2014-05-19  浏览次数:20716 次

能不能求个解析一段网页的正则表达式
<table   class= "inputTable "> <tr> <td   class= "formLabel ">
                                Terminal </td>
<td   class= "inactiveInputFieldWhite ">
CTA&nbsp;
</td>
<td   class= "inactiveField ">

geloescht   am   10.07.07   um   0014&nbsp;
</td>
</tr>

</table>

网页内容如上,如何写一个正则表达式把 <td> </td> 标签之间的内容入“geloescht   am   10.07.07   um   0014&nbsp;”提取出来。

谢谢!!

------解决方案--------------------
try

string yourStr = ..................;
MatchCollection mc = Regex.Matches(yourStr, @ " <td[^> ]*> \s*(? <content> [\s\S]*?)\s* </td> ", RegexOptions.IgnoreCase);
foreach (Match m in mc)
{
richTextBox2.Text += m.Groups[ "content "].Value + "\n ";
}