<%
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

public Function RemoveHTML(strHTML)
ON ERROR RESUME NEXT
Dim objRegExp, strOutput
strHTML = replace(strHTML," ","")
‘strHTML = replace(strHTML,chr(13),"")
‘strHTML = replace(strHTML,chr(10),"")
strHTML = replace(strHTML,chr(32),"")
       
    Set objRegExp = New Regexp
    objRegExp.IgnoreCase = True        ‘忽略大小写
    objRegExp.Global = True        ‘设置为全文搜索
    objRegExp.Pattern = "<script.+?>[\s\S]+?<\/script>"
    strOutput = objRegExp.Replace(strHTML, "")
    objRegExp.Pattern = "<style.+?>[\s\S]+?<\/style>"
    strOutput = objRegExp.Replace(strOutput, "")
    objRegExp.Pattern = "<.+?>"        ‘取闭合的<>
    strOutput = objRegExp.Replace(strOutput, "")
       
    strOutput = Replace(strOutput, "<", "〈")
    strOutput = Replace(strOutput, ">", "〉")
    RemoveHTML = strOutput  
    Set objRegExp = Nothing
End Function

Function NoHtml(htmlCode)
Dim text
text = htmlCode
text = FilterHTML(text)
text = RemoveHTML(text)
text=replace(text,chr(13)&chr(10),"<br>")
NoHtml=text
End Function
‘调用
‘code =HTML代码
‘code = NoHtml(code)
%>