去掉html标记的函数

Function stripHTML(strHTML)
Dim objRegExp, strOutput
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<.+?>"
  'Replace all HTML tag matches with the empty string
strOutput = objRegExp.Replace(strHTML, "")
  'Replace all < and > with < and >
strOutput = Replace(strOutput, "<", "<")
strOutput = Replace(strOutput, ">", ">")
stripHTML = strOutput 'Return the value of strOutput
Set objRegExp = Nothing
End Function

posted @ 2007-08-09 19:26  missthe  阅读(154)  评论(0编辑  收藏  举报