62,263
社区成员
发帖
与我相关
我的任务
分享string str = @"<img width=100 src=""files.jpg""> This is a test page <img width=100 src=""files2.jpg""> hello world, html test <img width=100 src=""ffword.jpg""> from here, wodd. <span></span>
This is a test page <img width=100 src=""files2.jpg""> hello world, html test <img width=100 src=""ffword.jpg""> from here, wodd. <span></span>";
MatchCollection mc = Regex.Matches(str, @"<img((?!img)[\s\S])+?<span></span>");
foreach (Match m in mc)
{
Console.WriteLine(m);
}