如何编写一个过滤掉HTML代码的函数?
来源:asp之家 时间:2009-11-08 18:53:00
过滤html代码的函数,当然也可以使用正则表达式。
<%
Function FilterHTML(strToFilter)
Dim strTemp
strTemp = strToFilter
While Instr(1,strTemp,"<") AND Instr(1, strTemp, ">")
strTemp = Left(strTemp, Instr(1, strTemp, "<")-1) & Right(strTemp, Len(strTemp)-Instr(1,strTemp, ">"))
WEnd
FilterHTML = strTemp
End Function
%>
正则表达式规则:<.+?>
标签:过滤,html,函数
0
投稿
猜你喜欢
Windows Server 2003 服务器安全设置--防火墙篇
2010-07-22 22:45:00
关于数据库的alter table操作和索引概念
2009-12-15 21:57:00
asp内置对象Application详解
2007-09-19 12:08:00
JavaScript 全半角转换
2010-02-04 17:14:00
DBA经验:如何进行MySQL数据库表的故障检测
2009-02-12 17:37:00
分享个asp文件缓存代码,使程序从缓存读数据
2011-03-09 19:47:00
PL/SQL number型数据
2009-02-26 10:59:00
如何使用Iframe实现本页提交?
2010-06-05 12:36:00
Dreamweaver4探谜系列(1)
2010-09-05 21:12:00
讲解SQL Server2005数据项的分拆与合并
2009-01-04 14:40:00
asp是的日期转换为星座的函数
2011-02-26 11:11:00
MySQL Dump/Restore
2010-10-14 13:49:00
Shellcode加密解密函数
2009-04-24 11:18:00
MySQL 定时器EVENT学习
2010-10-14 13:55:00
Asp无组件生成缩略图
2007-10-26 12:08:00
eWebEditor不支持IE,IE8,IE7,火狐,遨游的解决方法
2011-06-06 07:57:00
你需要知道的CSS3 动画技术[译]
2009-12-30 17:02:00
使用单通道实现半透明效果
2009-12-12 17:40:00
用伪类:hover实现提示效果
2008-05-29 12:59:00
MSSQL 基本语法及实例操作语句
2012-07-11 15:40:09