日期:2014-05-17 浏览次数:21186 次
string html = @"<tr>
<td class=""www""><a href=""连接1.html"">连接1</a>
</td>
</tr>
<tr>
<td class=""www""><a href=""连接2.html"">连接2</a>
</td>
</tr>";
foreach (Match m in System.Text.RegularExpressions.Regex.Matches(html, @"(?is)<td[^>]*?class=""www"">\s*<a\s*href=""(?<href>[^""]*?)""[^>]*?>(?<text>.*?)</a>\s*</td>"))
{
Console.WriteLine(m.Groups["href"].Value + "\t" + m.Groups["text"].Value);
}