C# .NET 使用正则获取a标签href属性

MatchCollection matches = Regex.Matches(content, @"<a[^>]*href=([""'])?(?<href>[^'""]+)\1[^>]*>", RegexOptions.IgnoreCase);
foreach (Match item in matches)
{
  var href= item.Groups[1].Value;
}