using System.Text.RegularExpressions;string s = "................";Regex re = new Regex(@"<td[^>]*>(?<data>.*?)</td>", RegexOptions.IgnoreCase|RegexOptions.Singleline);foreach (Match m in re.Matches(s))
Console.WriteLine(m.Groups["data"].Value);
Console.WriteLine(m.Groups["data"].Value);
<TR class=dbt4 align=middle>
......
</TR>
之间的数据,舍弃不在这个代码块中的数据
if (m2.Success)
{
s = m2.Groups["value"].Value;
re = new Regex(@"<td[^>]*>(?<data>.*?)</td>", RegexOptions.IgnoreCase|RegexOptions.Singleline); foreach (Match m in re.Matches(s))
Console.WriteLine(m.Groups["data"].Value);
}
Regex re = new Regex(@"<TR class=dbt4 align=middle>\s*(<td[^>]*>(?<data>.*?)</td>\s*)+\s*</TR>", RegexOptions.IgnoreCase|RegexOptions.Singleline);Match m = re.Match(s);
if (m.Success)
{
foreach (Capture c in m.Groups["data"].Captures)
Console.WriteLine(c.Value);
}