62,046
社区成员
发帖
与我相关
我的任务
分享
string str = "abcdef<img src='1.img'/>hijk<img width='20px' src='2.img'/>lmno<img height='20px' src='3.img'/>pqrst";
string result = Regex.Replace(str, @"(?is)<img[^>]*?>", "");
Response.Write(result);
Regex.Replace("abcdef<img src='1.img'/>hijk<img width='20px' src='2.img'/>lmno<img height='20px' src='3.img'/>pqrst
", "<.+?>", string.Empty)
string str = "abcdef<img src='1.img'/>hijk<img width='20px' src='2.img'/>lmno<img height='20px' src='3.img'/>pqrst";
string result = Regex.Replace(str, @"(?is)<img[^>]*?src=(['""\s]?)([^'""\s]+)\1[^>]*?>", "");
Response.Write(result);