正则表达式过滤html标签对

淡咖啡的味道

淡咖啡的味道

2016-02-19 15:01

每个人都希望每天都是开心的,不要因为一些琐事扰乱了心情还,闲暇的时间怎么打发,关注图老师可以让你学习更多的好东西,下面为大家推荐正则表达式过滤html标签对,赶紧看过来吧!

    public string DealHtml(string str)

{

//str = Regex.Replace(str, @"(img)[^]*|/(img)", "", RegexOptions.IgnoreCase);

str = Regex.Replace(str, @"(table|tbody|tr|td|th)[^]*|/(table|tbody|tr|td|th)", "", RegexOptions.IgnoreCase);

str = Regex.Replace(str, @"(div|blockquote|fieldset|legend)[^]*|/(div|blockquote|fieldset|legend)", "", RegexOptions.IgnoreCase);

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/webkaifa/)

//str = Regex.Replace(str, @"(font|i|u|h[1-9]|s)[^]*|/(font|i|u|h[1-9]|s)", "", RegexOptions.IgnoreCase);

//str = Regex.Replace(str, @"(style|strong)[^]*|/(style|strong)", "", RegexOptions.IgnoreCase);

//str = Regex.Replace(str, @"a[^]*|/a", "", RegexOptions.IgnoreCase);

//str = Regex.Replace(str, @"(meta|iframe|frame|span|tbody|layer)[^]*|/(iframe|frame|meta|span|tbody|layer)", "", RegexOptions.IgnoreCase);

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/webkaifa/)

str = Regex.Replace(str, @"br[^]*", "", RegexOptions.IgnoreCase);

str = str.Replace("br", "");

return str;

}

展开更多 50%)
分享

猜你喜欢

正则表达式过滤html标签对

Web开发
正则表达式过滤html标签对

正则表达式过滤html的标签对

Web开发
正则表达式过滤html的标签对

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

用正则表达式过滤html代码

Web开发
用正则表达式过滤html代码

c#中过滤html的正则表达式

Web开发
c#中过滤html的正则表达式

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

正则表达式

Web开发
正则表达式

正则表达式口诀 正则表达式学习工具

Web开发
正则表达式口诀 正则表达式学习工具

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

在PowerPoint2010中插入公式

在PowerPoint2010中插入公式

run.vbs run2.vbs怎么清除

run.vbs run2.vbs怎么清除
下拉加载更多内容 ↓