62,046
社区成员
发帖
与我相关
我的任务
分享
string imglist = "13131<img src=\"1.gif\" alt=\"\"/>dsdfsdf<img src=\"2.gif\" alt=\"\"/>dsdfsdf<img src=\"3.gif\" alt=\"\"/>dsdfsdf";
Regex reg = new Regex(@"(?is)<img[^>]*?src=([""']?)(?<src>[^""'>\s]+)\1[^>]*>"); MatchCollection mc = reg.Matches(yourStr); foreach (Match m in mc) { richTextBox2.Text += m.Groups["src"].Value + "\n"; }
} Regex reg = new Regex(@"(?is)<img[^>]*?src=([""']?)(?<src>[^""'>\s]+)\1[^>]*>");
MatchCollection mc = reg.Matches(yourStr);
foreach (Match m in mc)
{
richTextBox2.Text += m.Groups["src"].Value + "\n";
}