过滤html代码,包括script,stype,<标签>
'**************************************************
'函数名:RemoveHTML
'作 用:过滤html代码
'参 数:strHTML-----要过滤的字符
'返回值:过滤后的字符
'**************************************************
Function RemoveHTML(str)
Dim objRegExp, Match, Matches,strHTML
if isnull(str) then
str=""
end if
strHTML=str
strHTML=replace(replace(replace(strHTML,vblf,""),vbcr,""),vbcrlf,"")
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<script[^>]*?>.*?</script>"
strHTML = objRegExp.Replace(strHTML,"")
objRegExp.Pattern = "<style[^>]*?>.*?</style>"
strHTML = objRegExp.Replace(strHTML,"")
objRegExp.Pattern = "<.+?>"
strHTML = objRegExp.Replace(strHTML,"")
RemoveHTML=strHTML
Set objRegExp = Nothing
End Function