% 'Wrtten by i{At}CnLei.Com Function lFilterBadHTML(byval strHTML,byval strTAGs) Dim objRegExp,strOutput Dim arrTAG,i arrTAG=Split(strTAGs,",") Set objRegExp = New Regexp strOutput=strHTML objRegExp.IgnoreCase = True objRegExp.Global = True For i=0 to UBound(arrTAG) objRegExp.Pattern = ""arrTAG(i)"[\s\S]+/"arrTAG(i)"*>" strOutput = objRegExp.Replace(strOutput, "") Next Set objRegExp = Nothing lFilterBadHTML = strOutput End Function
'Example Dim sPageCont sPageCont= "...网页正文内容..." sPageCont=FilterBadHTML(sPageCont,"script,iframe,object,table") %>