ScriptHtml 函数之过滤html标记的asp代码
'==================================================
'函数名:scripthtml
'作 用:过滤html标记
'参 数:constr ------ 要过滤的字符串
'==================================================
function scripthtml(byval constr,tagname,ftype)
dim re
set re=new regexp
re.ignorecase =true
re.global=true
select case ftype
case 1
re.pattern="<" & tagname & "([^>])*>"
constr=re.replace(constr,"")
case 2
re.pattern="<" & tagname & "([^>])*>.*?</" & tagname & "([^>])*>"
constr=re.replace(constr,"")
case 3
re.pattern="<" & tagname & "([^>])*>"
constr=re.replace(constr,"")
re.pattern="</" & tagname & "([^>])*>"
constr=re.replace(constr,"")
end select
scripthtml=constr
set re=nothing
end function
如对本文有疑问,
点击进行留言回复!!
网友评论