110,533
社区成员
发帖
与我相关
我的任务
分享
Regex reg = new Regex("<td class=xt>([\\s\\S]*)<a href=\"(?<url>.*?)\">(?<text>.*?)</a><br/>([\\s\\S]*)更新时间:(?<time>.*?) 点击");
MatchCollection mc = reg.Matches(ssstr);//ssstr就是下面的内容。采集到的
richTextBox1.Text += "\r\n" + mc.Count + "****";//不管ssstr有多少实际数据,都只输出1
foreach (Match m in mc)
{
richTextBox1.Text += "\r\n" + m.Groups["url"].Value + " 时间:" + m.Groups["time"].Value;//输出最后一个值
}
<td class=bt>摘要</td>
<td class=bt width=10%>作者</td>
</tr>
<tr bgcolor=#ffffff>
<td class=xt align=center><a href="/id/2724864"><img src="http://img.simplecd.org/image/2724864.jpg" title="《VOA Learning English_2011》[压缩包]" width=80 height=80/></a></td>
<td class=xt>
<a href="/id/2724864">《VOA Learning English_2011》[压缩包]</a><br/>
发行日期: 2011年对白语言: 英语文字语言: 英文<br/>
更新时间:2011/07/22 11:11:59 点击:2109559<br/>
</td>
<td class=xt><a href="/user/shenning64">shenning64</a></td>
</tr>
<tr bgcolor=#ffffff>
<td class=xt align=center><a href="/id/2880729"><img src="http://img.simplecd.org/image/2880729.jpg" title="《一起看动画》(Animation together)2011年首发动画类电子杂志[201106]第六期发布了!!!" width=80 height=80/></a></td>
<td class=xt>
<a href="/id/2880729">《一起看动画》(Animation together)2011年首发动画类电子杂志[201106]第六期发布了!!!</a><br/>
Douban5382879:8.9(2198 votes)发行时间: 2011年01月15日<br/>
更新时间:2011/07/22 09:51:58 点击:63180<br/>
</td>
<td class=xt><a href="/user/cgmentor">cgmentor</a></td>
</tr>
</table>
<table cellpadding=0 cellspacing=0 align=center width=1000>
<tr><td align=center width=1000>
Regex reg = new Regex(@"(?is)<td class=xt>\s*<a href=""(?<url>[^""]*?)""[^>]*>(?<text>[^<]*?)</a><br/>.*?更新时间:(?<time>.*?) 点击");