站长资源网络编程

asp.net 过滤图片标签的正则

整理:jimmy2026/8/4浏览2
简介复制代码 代码如下:public static string replaceImgUrl(string html) { if (html == null) return ""; System.Text.RegularExpressions.Regex regex = new System.Text.
复制代码 代码如下:
public static string replaceImgUrl(string html)
{
if (html == null)
return "";

System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(@"\<img[^\>]+\>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
html = regex.Replace(html, ""); //过滤frameset
return html;
}