手机
当前位置:查字典教程网 >编程开发 >ASP教程 >asp中格式化HTML函数代码 SDCMS加强版
asp中格式化HTML函数代码 SDCMS加强版
摘要:复制代码代码如下:'=============================='格式化HTML,SDCMS加强版'============...

复制代码 代码如下:

'==============================

'格式化HTML,SDCMS加强版

'==============================

Function Nohtml(ByVal t0)

IF Len(t0)=0 Or IsNull(t0) Then

Nohtml=""

Exit Function

End IF

Dim Regs,Matches,Match

Set Regs=New Regexp

Regs.Ignorecase=True

Regs.Global=True

'过滤掉JS,Iframe

Regs.pattern ="<script.+?/script>"

t0=Regs.Replace(t0,"")

Regs.pattern ="<iframe.+?/iframe>"

t0=Regs.Replace(t0,"")

'再过滤其他

Regs.Pattern="<.+?>"

Set Matches=Regs.Execute(t0)

IF Matches.Count>0 Then

For Each Match In Matches

t0=Replace(t0,Match.value,"")

Next

End IF

t0=Replace(t0,"","")

t0=Replace(t0,vbCrLf,"")

t0=Replace(t0,"","")

t0=Replace(t0," ","")

t0=Replace(t0,CHR(9),"")

t0=Replace(t0,CHR(13),"")

t0=Replace(t0,CHR(10),"")

t0=Replace(t0,CHR(22),"")

Set Regs=Nothing

Nohtml=t0

End Function

【asp中格式化HTML函数代码 SDCMS加强版】相关文章:

asp 获取地址栏参数代码

ASP中字符与数字操作函数总结

asp代码实现access数据导出到excel文件

asp防止网页刷新代码

用正则表达式写的HTML分离函数

ASP中的EVAL函数使用教程

asp中FSO复制文件代码

asp之字符串操作函数

asp 查询数据代码

asp中get post提交表单区别

精品推荐
分类导航