111,119
社区成员
发帖
与我相关
我的任务
分享 string html = "878uiii <a href=\"www.csdn.com\">csdn </a>8768yuuy";
Regex reg = new Regex(@"<a[^>]+>[^>]*</a>");
MatchCollection mc = reg.Matches(html);
Console.WriteLine("/*\n------输出结果------------");
foreach (Match m in mc)
{
Console.WriteLine(m.Groups[0].ToString());
}
/*
------输出结果------------
<a href="www.csdn.com">csdn </a>
*/