string pattern = @"<a[^>]*href=(""(?<href>[^""]*)""|'(?<href>[^']*)'|(?<href>[^\s>]*))[^>]*>(?<text>[\s\S]*?)</a>";

MatchCollection mcs = Regex.Matches(contenhtml, pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);

href =mcs[0].Groups["href"].Value;

text=mcs[0].Groups["text"].Value;

相关文章: