string reg = @"<a[^>]*href=([""‘])?(?<href>[^‘""]+)\1[^>]*>"; MatchCollection matches = Regex.Matches(content, reg, RegexOptions.IgnoreCase); foreach (Match item in matches) { var href= item.Groups[1].Value; }
时间: 2024-11-08 23:52:49
string reg = @"<a[^>]*href=([""‘])?(?<href>[^‘""]+)\1[^>]*>"; MatchCollection matches = Regex.Matches(content, reg, RegexOptions.IgnoreCase); foreach (Match item in matches) { var href= item.Groups[1].Value; }