调查报告感悟:正则表达式为什么没有过滤这代码??

来源:百度文库 编辑:神马品牌网 时间:2024/05/02 18:36:56
我用的是以下正则表达式

Function stripHTML(strHTML)
Dim objRegExp, strOutput
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<.+?>" '代表<.......>
strOutput = objRegExp.Replace(strHTML, "")'是替换啊,把<.+?>替换为""不显示,你可以使用"*"看效果
strOutput = Replace(strOutput, "<", "<")
strOutput = Replace(strOutput, ">", ">")
stripHTML = strOutput
Set objRegExp = Nothing
End Function

但是我读数据库的值是还有有这样的标签,如下是我从数据库中用正则表达式读出的数据:
screen.width-333)this.width=screen.width-333" border=0>新款风扇 screen.width-333)this.width=screen.width-333" border=0>海尔的整体厨房 screen.width-333)this.width=screen.width-333" border=0>海尔的整体厨房 screen.width-333)this.width=screen.width-333" border=0>精美的电熨斗 screen.width-333)this.width=screen.width-333" border=0>各

请高手指导!!!!!