110,533
社区成员
发帖
与我相关
我的任务
分享
static void Main(string[] args)
{
Regex r = new Regex(@"<a\s*href='([^']+)\s*[^>]*>");
string str = @"<html> <body> <a href='我要获取此链接' >文本内容 </a> </body> </html>";
Match m;
for (m = r.Match(str); m.Success; m = m.NextMatch())
{
Console.WriteLine(m.Groups[1].ToString());
}
}