asp中格式化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
相关推荐
满地星辰 2020-09-16
有梦就能实现 2020-06-05
gcgl000hugang 2020-02-10
hellobabygogo 2020-03-06
wbingyang 2020-02-16
一对儿程序猿 2019-12-22
宿舍 2019-12-11
liangkaiping0 2011-09-23
niuyongaiai 2013-06-09
drise 2012-05-29
不懂 2019-06-28
shqhope 2020-06-23
WebVincent 2020-06-16
lynjay 2020-06-14
ajaxtony 2020-06-11
zhendeshifeng 2020-05-27
Yasin 2020-05-05
Darklovy 2020-04-16