<TABLE CELLSPACING=1 CELLPADDING=3 WIDTH="98%" ALIGN=center BORDER=0 BGCOLOR="#cccccc">
<TR bgcolor="#eeeeee">
<TD class=article1><FONT color="#ff6303"><B> 基本参数</B></FONT></TD>
<TD align="right" style="padding-right:10px"><img src="http://www.pconline.com.cn/product/images/200606_dian.gif" width="3" height="5" align="absmiddle"> <a href="http://pdlib.pconline.com.cn/product/guest/cavil4Guest.jsp?productId=183996" target="_blank"><font color="FF8000"><b>我要挑错</b></font></a></TD>
</TR>
<TR>
<TD CLASS=btd WIDTH=198 BGCOLOR="#FCFCFC"><B> 型号</B></TD>
<TD ALIGN=left WIDTH=316 BGCOLOR="#ffffff"> 6120c</TD>
</TR>
<TR>
<TD CLASS=btd WIDTH=198 BGCOLOR="#FCFCFC"><B> 上市时间</B></TD>
<TD ALIGN=left WIDTH=316 BGCOLOR="#ffffff"> 2007</TD>
</TR>
<TR>
<TD CLASS=btd WIDTH=198 BGCOLOR="#FCFCFC"><B> <a href="http://dict.pconline.com.cn/dic/sort.jsp?kindId=-1&dicId=275" target="_blank">网络制式</a></B></TD>
<TD ALIGN=left WIDTH=316 BGCOLOR="#ffffff"> WCDMA(3G),GSM 850/900/1800/1900</TD>
</TR>
<TR>
<TD CLASS=btd WIDTH=198 BGCOLOR="#FCFCFC"><B> 手机类型</B></TD>
<TD ALIGN=left WIDTH=316 BGCOLOR="#ffffff"> 直板</TD>
</TR>
<TR>
<TD CLASS=btd WIDTH=198 BGCOLOR="#FCFCFC"><B> <a href="http://dict.pconline.com.cn/dic/sort.jsp?kindId=-1&dicId=3168" target="_blank">主屏参数</a></B></TD>
<TD ALIGN=left WIDTH=316 BGCOLOR="#ffffff"> 彩屏,1600万色,TFT,240×320像素,2.0英寸</TD>
</TR>
</Table>
==============得到TD里面的值用逗号隔开就行啦
基本参数,我要挑错,型号,6120c,......等等
MatchCollection mc = Regex.Matches(yourStr, @"<td[^>]*?>[\s\S]*?</td>", RegexOptions.IgnoreCase);
foreach (Match m in mc)
{
richTextBox2.Text += Regex.Replace(m.Value, @"<[^>]*?>", "").Trim() + ",";
}用了两个正则,不是太优雅,我再看下
也挺厉害的 是不是都下班拉.
MatchCollection mc = Regex.Matches(yourStr, @"<td[^>]*?>(\s*?<[^>]*?>\s*?)*?(?<content>[^<>]*?)(\s*?<[^>]*?>\s*?)*?</td>", RegexOptions.IgnoreCase);
foreach (Match m in mc)
{
richTextBox2.Text += m.Groups["content"].Value.Trim() + ",";
}当然了,如果数据量大,还可以加个RegexOptions .Compiled,这样
MatchCollection mc = Regex.Matches(yourStr, @"<td[^>]*?>(\s*?<[^>]*?>\s*?)*?(?<content>[^<>]*?)(\s*?<[^>]*?>\s*?)*?</td>", RegexOptions.IgnoreCase | RegexOptions .Compiled);这只是在数据量比较大的情况下,否则不用加