asp.net 过滤图片标签的正则
来源:动视网
责编:小采
时间:2020-11-27 22:44:04
asp.net 过滤图片标签的正则
asp.net 过滤图片标签的正则: 代码如下:public static string replaceImgUrl(string html) { if (html == null) return ; System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(@\<
导读asp.net 过滤图片标签的正则: 代码如下:public static string replaceImgUrl(string html) { if (html == null) return ; System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(@\<

代码如下:
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;
}
asp.net 过滤图片标签的正则
asp.net 过滤图片标签的正则: 代码如下:public static string replaceImgUrl(string html) { if (html == null) return ; System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(@\<