110,473
社区成员
发帖
与我相关
我的任务
分享
<table border="0" width="556" cellpadding="0" bgcolor="#FFFFFF">
<tr><td width="130" valign="top"><p align="center"><img border="0" src="face/m02.gif"><br><Br>第<font color="#FF0000">1068</font>条留言</p></td>
<td width="425" valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tbody><tr><td width="43" colspan="2" rowspan="2" height="29">
<img border="0" src="/img/1_r2_c2.gif" width="43" height="29"></td>
<td height="10" background="/img/1_r2_c41.gif"></td>
<td width="37" colspan="2" rowspan="2" height="29">
<img border="0" src="/img/1_r2_c6.gif" width="37" height="29"></td></tr><tr><td height="19"><table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td width="60%"><div style="width:120;color:0099FF;filter:glow(color=00FF66, strength=1)">天之痕</div></td><td width="40%" align="right"></td></tr></table></td></tr><tr><td width="10" background="/img/1_r4_c2.gif"></td><td width="27"></td><td width="100%" height="50" style="table-layout:fixed; WORD-WRAP:break-word; word-break:break-all">
来看看
</td><td width="22"></td><td width="15" background="/img/1_r4_c2.gif"></td></tr><tr><td width="43" colspan="2" rowspan="2" height="26"><img border="0" src="/img/1_r6_c2.gif" width="43" height="27"></td><td height="16" align="right">
<img border="0" src="/img/ip.gif" width="16" height="15" title="116.19.*.*"><font color=#336600>[2009-6-25 16:41:41]</font></td><td width="43" colspan="2" rowspan="2" height="26"><img border="0" src="/img/1_r6_c6.gif" width="37" height="27"></td></tr><tr><td height="9" background="/img/1_r2_c4.gif"></td></tr></tbody></table>
</td></tr>
<tr><td width="640" colspan="2">
<hr SIZE="1" color=#F0F0F0></td></tr></table>
<table border="0" width="556" cellpadding="0" bgcolor="#FFFFFF">
<tr><td width="130" valign="top"><p align="center"><img border="0" src="face/m02.gif">
<br><Br>第<font color="#FF0000">1068</font>条留言</p></td>
<td width="425" valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tbody><tr><td width="43" colspan="2" rowspan="2" height="29">
<img border="0" src="/img/1_r2_c2.gif" width="43" height="29"></td>
<td height="10" background="/img/1_r2_c41.gif"></td>
<td width="37" colspan="2" rowspan="2" height="29">
<img border="0" src="/img/1_r2_c6.gif" width="37" height="29"></td></tr><tr><td height="19">
<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td width="60%">
<div style="width:120;color:0099FF;filter:glow(color=00FF66, strength=1)">天之痕奔波</div></td>
<td width="40%" align="right"></td></tr></table>
</td></tr><tr><td width="10" background="/img/1_r4_c2.gif">
</td><td width="27"></td>
<td width="100%" height="50" style="table-layout:fixed; WORD-WRAP:break-word; word-break:break-all">
来看看 还是一片枯叶飘过。。。休~~~~呜~呼呼~
</td><td width="22"></td><td width="15" background="/img/1_r4_c2.gif"></td></tr><tr>
<td width="43" colspan="2" rowspan="2" height="26">
<img border="0" src="/img/1_r6_c2.gif" width="43" height="27">
</td><td height="16" align="right">
<img border="0" src="/img/ip.gif" width="16" height="15" title="116.19.*.*">
<font color=#336600>[2009-6-25 16:41:41]</font></td>
<td width="43" colspan="2" rowspan="2" height="26">
<img border="0" src="/img/1_r6_c6.gif" width="37" height="27">
</td></tr><tr><td height="9" background="/img/1_r2_c4.gif">
</td></tr></tbody></table>
</td></tr>
<tr><td width="640" colspan="2">
<hr SIZE="1" color=#F0F0F0></td></tr></table>
string s = @"<table border=""""0"""" width=""556"" cellpadding=""0"" bgcolor=""#FFFFFF"">
<tr><td width=""130"" valign=""top""><p align=""center""><img border=""0"" src=""face/m02.gif"">
<br><Br>第<font color=""#FF0000"">1068</font>条留言</p></td>
<td width=""425"" valign=""top"">
<table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"">
<tbody><tr><td width=""43"" colspan=""2"" rowspan=""2"" height=""29"">
<img border=""0"" src=""/img/1_r2_c2.gif"" width=""43"" height=""29""></td>
<td height=""10"" background=""/img/1_r2_c41.gif""></td>
<td width=""37"" colspan=""2"" rowspan=""2"" height=""29"">
<img border=""0"" src=""/img/1_r2_c6.gif"" width=""37"" height=""29""></td></tr><tr><td height=""19"">
<table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0""><tr><td width=""60%"">
<div style=""width:120;color:0099FF;filter:glow(color=00FF66, strength=1)"">天之痕奔波</div></td>
<td width=""40%"" align=""right""></td></tr></table>
</td></tr><tr><td width=""10"" background=""/img/1_r4_c2.gif"">
</td><td width=""27""></td>
<td width=""100%"" height=""50"" style=""table-layout:fixed; WORD-WRAP:break-word; word-break:break-all"">
来看看 还是一片枯叶飘过。。。休~~~~呜~呼呼~
</td><td width=""22""></td><td width=""15"" background=""/img/1_r4_c2.gif""></td></tr><tr>
<td width=""43"" colspan=""2"" rowspan=""2"" height=""26"">
<img border=""0"" src=""/img/1_r6_c2.gif"" width=""43"" height=""27"">
</td><td height=""16"" align=""right"">
<img border=""0"" src=""/img/ip.gif"" width=""16"" height=""15"" title=""116.19.*.*"">
<font color=#336600>[2009-6-25 16:41:41]</font></td>
<td width=""43"" colspan=""2"" rowspan=""2"" height=""26"">
<img border=""0"" src=""/img/1_r6_c6.gif"" width=""37"" height=""27"">
</td></tr><tr><td height=""9"" background=""/img/1_r2_c4.gif"">
</td></tr></tbody></table>
</td></tr>
<tr><td width=""640"" colspan=""2"">
<hr SIZE=""1"" color=#F0F0F0></td></tr></table>";
Regex reg = new Regex(@"第.*>(?<count>\d+)<.*条留言[\s\S]*
<div.*>(?<actor>.*)<\/div>[\s\S]*
<td\swidth\=""100%"".*>(?<content>[^<]+)<[\s\S]*
\[(?<date>.*)\][\s\S]*");
MatchCollection mc = reg.Matches(s);
foreach (Match m in mc)
{
Console.WriteLine("条数:" + m.Groups["count"].ToString() + "\r\n"
+ "发帖人:" + m.Groups["actor"].ToString() + "\r\n"
+ "内容:" + m.Groups["content"].ToString() + "\r\n"
+ "时间:" + m.Groups["date"].ToString());
}
/* *****************************结果*********************
条数:1068
发帖人:天之痕奔波
内容:
来看看 还是一片枯叶飘过。。。休~~~~呜~呼呼~
时间:2009-6-25 16:41:41
*/