'删除字符串中的HTML代码 function nohtml(str) dim re Set re=new RegExp re.IgnoreCase =true re.Global=True re.Pattern="(/<.[^/<]*/>)" str=re.replace(str," ") re.Pattern="(/<//[^/<]*/>)" str=re.replace(str," ") nohtml=str set re=nothing end function ========================================= '删除字符串中的HTML代码 Function DelHtml(Str1) Dim regEx Set regEx = New RegExp regEx.Pattern = "(<[^>]*?>)" regEx.Global = True regEx.IgnoreCase = True DelHtml = replace(regEx.Replace(""&str1,"")," ","") End Function ========================================= '删除字符串中的HTML代码 Function DelHtml(ContentStr) Dim TempLoseStr, regEx TempLoseStr = CStr(ContentStr) Set regEx = New RegExp regEx.Pattern = "<//*[^<>]*>" regEx.IgnoreCase = True regEx.Global = True TempLoseStr = replace(regEx.Replace(TempLoseStr,"")," ","") DelHtml = TempLoseStr End Function ========================================= Public Function LoseHtml(ContentStr) On Error Resume Next Dim TempLoseStr, regEx If ContentStr="" Or ContentStr=Null Then Exit Function TempLoseStr = CStr(ContentStr) Set regEx = New RegExp regEx.Pattern = "<//*[^<>]*>" regEx.IgnoreCase = True regEx.Global = True TempLoseStr = regEx.Replace(TempLoseStr, "") LoseHtml = TempLoseStr End Function