读书人

能不能求个解析一段网页的正则表达式,

发布时间: 2012-03-27 13:44:24 作者: rapoo

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

geloescht am 10.07.07 um 0014 
</td>
</tr>

</table>

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

谢谢!!

[解决办法]
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 ";
}

读书人网 >C#

热点推荐