<script type="text/javascript"> //思路分两步:作者(yanue). //1,匹配出图片img标签(即匹配出所有图片),过滤其他不需要的字符 //2.从匹配出来的结果(img标签中)循环匹配出图片地址(即src属性) var str = "this is test string <img src=\"http:yourweb.com/test.jpg\" width='50' > 123 and th…
public static string RemoveAllAttributesWithoutSrc(string input) { string pattern = @"<([a-z][a-z0-9]*)(?:[^>]*(\ssrc=['\""][^'\""]*['\""]))?[^>]*?(\/?)>"; var result =…