110,545
社区成员
发帖
与我相关
我的任务
分享
string str = @"<img alt="""" src=""http://www.xxx.cn/upload/xxx/xxx/001_0001.jpg"" style=""width: 274px; height: 184px"" />
<img alt="""" src=""http://www.xxx.cn/upload/xxx/xxx/001.jpg"" style=""width: 274px; height: 184px"" />";
Regex reg = new Regex(@"(?is)<img((?:(?!/\s*>).)*)");
foreach (Match m in reg.Matches(str))
Response.Write(m.Groups[1].Value+"<br/>");
/*
alt="" src="http://www.xxx.cn/upload/xxx/xxx/001_0001.jpg" style="width: 274px; height: 184px"
alt="" src="http://www.xxx.cn/upload/xxx/xxx/001.jpg" style="width: 274px; height: 184px"
*/