去除网站中HTML标签的正则表达式
来源:互联网 发布:小黑屋写作软件怎么样 编辑:程序博客网 时间:2024/06/05 07:22
string str = a.ToString();
str = Regex.Replace(str, @"</?span[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"&#[^>]*;", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?marquee[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?object[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?param[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?embed[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?table[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @" ","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?tr[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?th[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?p[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?a[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?img[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?tbody[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?li[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?span[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?div[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?th[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?td[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?script[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"(javascript|jscript|vbscript|vbs):", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"on(mouse|exit|error|click|key)", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"<//?xml[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"<//?[a-z]+:[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?font[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?b[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?u[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?i[^>]*>","",RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?strong[^>]*>","",RegexOptions.IgnoreCase);
- 去除网站中HTML标签的正则表达式
- Java中正则表达式去除html标签
- 【Java】中正则表达式去除html标签
- 正则表达式去除html标签
- 正则表达式去除html标签
- java正则表达式去除html中所有的标签和特殊HTML字符
- ASP去除HTML标签的——正则表达式应用
- java使用正则表达式去除字符串的html标签
- C#去除一段字符串内的HTML标签,正则表达式
- 利用正则表达式去除HTML标签
- 正则表达式,去除所有HTML标签
- 正则表达式,去除所有HTML标签
- java正则表达式去除html标签
- python正则表达式去除html标签
- C# 正则表达式,去除所有HTML标签
- 正则表达式,去除所有HTML标签
- 正则表达式,去除所有HTML标签
- java中利用正则去除html标签
- VC++ Dialog & Windows 使用技巧(一)
- JavaScript 获取客户端计算机硬件及系统信息(转载)
- 本人服务器遭受黑客长期攻击,特把这几天做的一些有用的安全方面总结出来,以方便以后查阅
- Valgrind内存调试工具
- Writing AVI files in OpenCV
- 去除网站中HTML标签的正则表达式
- 无法打开包括文件:“alloc.h”
- FFMPEG + Windows
- http协议详解
- 问题
- W3C对于CSS及浏览器之间的兼容性问题解决方案
- PL/SQL 中的SQL语句
- C# 寻找接近值
- VC++ Dialog & Windows 使用技巧(二)