110,567
社区成员
发帖
与我相关
我的任务
分享
MatchCollection mc = Regex.Matches(yourStr, @"(?i)<a(?>(?:(?!href=)[^>])*)href=(['""]?)(?<url>[^""'\s>]*)\1[^>]*>(?<text>[\s\S]*?)</a>");
foreach (Match m in mc)
{
richTextBox2.Text += m.Value + "\n"; //a标签
richTextBox2.Text += m.Groups["url"].Value + "\n"; //url
richTextBox2.Text += m.Groups["text"].Value + "\n"; //文字
}