MatchCollection mc = Regex.Matches(yourStr, @" <a[^>]*href=(['""]?)(?<url>[^""\s>]*)\1[^>]*>(?<text>[\s\S]*?)</a> ", RegexOptions.IgnoreCase); foreach (Match m in mc) { richTextBox2.Text += m.Groups[ " url "].Value + " \n "; richTextBox2.Text += m.Groups[ " text "].Value+ " \n "; }
c# 正则提取网页链接
最新推荐文章于 2023-03-31 08:36:27 发布