求正则表达式 先把<td>标签和</td></tr>去掉再用<tr>分组就可以了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用<table><tr> -----行 <td></td> -----列</tr></table>划分 System.Text.RegularExpressions.Regex r=new System.Text.RegularExpressions.Regex (@"<td class=""ColValue"" align=""center"">(?<content>.*?)</td>",System.Text.RegularExpressions.RegexOptions.Multiline); System.Text.RegularExpressions.MatchCollection mc= r.Matches(w); foreach ( System.Text.RegularExpressions.Match var in mc) { Console.WriteLine(var.Groups["content"].Value); }如果不要<td class="ColValue" align="center"> <a href="Detail.jsp?type=9&id=7501000000000078"> 3501000609992007060 </a> </td> 判断一下再删除就好了,懒得改正则了呵呵 忘加内容了 string w = @"<tr align=""center"" class=""evenSelNone"" onDblClick=""openDetail(this)"" onclick=""rowSelected(this)"" ref=""Detail.jsp?type=9&id=7501000000000078""> <td class=""ColValue"" align=""center""> 1 </td> <td class=""ColValue"" align=""center""> <a href=""Detail.jsp?type=9&id=7501000000000078""> 3501000609992007060 </a> </td> <td class=""ColValue"" align=""center""> 无名士 </td> <td class=""ColValue"" align=""center""> 男 </td> <td class=""ColValue"" align=""center""> 15113131333333X </td> <td class=""ColValue"" align=""center""> 福建福州 </td> <td class=""ColValue"" align=""center""> 琅岐镇 </td> <td class=""ColValue"" align=""center""> 测试 </td> <td class=""ColValue"" align=""center""> 福建福州市 </td> <td class=""ColValue"" align=""center""> 2007-09-04 </td> </tr> <tr align=""center"" class=""evenSelNone"" onDblClick=""openDetail(this)"" onclick=""rowSelected(this)"" ref=""Detail.jsp?type=9&id=7501000000000078""> <td class=""ColValue"" align=""center""> 2 </td> <td class=""ColValue"" align=""center""> <a href=""Detail.jsp?type=9&id=7501000000000078""> 750100050999200705 </a> </td> <td class=""ColValue"" align=""center""> 无名士2 </td> <td class=""ColValue"" align=""center""> 男 </td> <td class=""ColValue"" align=""center""> 15113131333333Y </td> <td class=""ColValue"" align=""center""> 福建福州 </td> <td class=""ColValue"" align=""center""> 同桌 </td> <td class=""ColValue"" align=""center""> 测试Y </td> <td class=""ColValue"" align=""center""> 福建福州市 </td> <td class=""ColValue"" align=""center""> 2007-08-04 </td> </tr> "; System.Text.RegularExpressions.Regex r=new System.Text.RegularExpressions.Regex (@"<td class=""ColValue"" align=""center"">(?<content>.*?)</td>",System.Text.RegularExpressions.RegexOptions.Multiline); System.Text.RegularExpressions.MatchCollection mc= r.Matches(w); foreach ( System.Text.RegularExpressions.Match var in mc) { Console.WriteLine(var.Groups["content"].Value); } DIspose模式的疑惑 读取数据库信息关于dataReader问题 求助,生成一张答题卡报表,重谢!!! 高手帮忙,下面有一段调用API画框的函数,不知道怎么调的! 最近被一个对象数组问题,搞晕了,不知道该怎么取出,请施以援手谢谢了 “Sources”参数不支持重复项 问一个关于在C#中MediaPlayer控件编程的问题. 我在WORD模板中插入了一个书签,能不能在书签前面插入图片??? 关于限制文件上传 各位大大进来下,ComboBox的问题 csdnder,邦忙下 C#中的即时聊天程序问题?
<table>
<tr> -----行
<td></td> -----列
</tr>
</table>
划分
System.Text.RegularExpressions.Regex r=new System.Text.RegularExpressions.Regex (@"<td class=""ColValue"" align=""center"">(?<content>.*?)</td>",System.Text.RegularExpressions.RegexOptions.Multiline);
System.Text.RegularExpressions.MatchCollection mc= r.Matches(w);
foreach ( System.Text.RegularExpressions.Match var in mc)
{
Console.WriteLine(var.Groups["content"].Value);
}如果不要<td class="ColValue" align="center"> <a href="Detail.jsp?type=9&id=7501000000000078"> 3501000609992007060 </a> </td> 判断一下再删除就好了,懒得改正则了呵呵
<td class=""ColValue"" align=""center""> 1 </td>
<td class=""ColValue"" align=""center""> <a href=""Detail.jsp?type=9&id=7501000000000078""> 3501000609992007060 </a> </td>
<td class=""ColValue"" align=""center""> 无名士 </td>
<td class=""ColValue"" align=""center""> 男 </td>
<td class=""ColValue"" align=""center""> 15113131333333X </td>
<td class=""ColValue"" align=""center""> 福建福州 </td>
<td class=""ColValue"" align=""center""> 琅岐镇 </td>
<td class=""ColValue"" align=""center""> 测试 </td>
<td class=""ColValue"" align=""center""> 福建福州市 </td>
<td class=""ColValue"" align=""center""> 2007-09-04 </td>
</tr> <tr align=""center"" class=""evenSelNone"" onDblClick=""openDetail(this)"" onclick=""rowSelected(this)"" ref=""Detail.jsp?type=9&id=7501000000000078"">
<td class=""ColValue"" align=""center""> 2 </td>
<td class=""ColValue"" align=""center""> <a href=""Detail.jsp?type=9&id=7501000000000078""> 750100050999200705 </a> </td>
<td class=""ColValue"" align=""center""> 无名士2 </td>
<td class=""ColValue"" align=""center""> 男 </td>
<td class=""ColValue"" align=""center""> 15113131333333Y </td>
<td class=""ColValue"" align=""center""> 福建福州 </td>
<td class=""ColValue"" align=""center""> 同桌 </td>
<td class=""ColValue"" align=""center""> 测试Y </td>
<td class=""ColValue"" align=""center""> 福建福州市 </td>
<td class=""ColValue"" align=""center""> 2007-08-04 </td>
</tr>
";
System.Text.RegularExpressions.Regex r=new System.Text.RegularExpressions.Regex (@"<td class=""ColValue"" align=""center"">(?<content>.*?)</td>",System.Text.RegularExpressions.RegexOptions.Multiline);
System.Text.RegularExpressions.MatchCollection mc= r.Matches(w);
foreach ( System.Text.RegularExpressions.Match var in mc)
{
Console.WriteLine(var.Groups["content"].Value);
}