<% Function RegExpTest(patrn, strng) Dim regEx, Match, Matches ' 建立變量。 Set regEx = New RegExp ' 建立正則表達式。 regEx.Pattern = patrn ' 設置模式。 regEx.IgnoreCase = False ' 設置是否區分字符大小寫。 regEx.Global = True ' 設置全局可用性。 Set Matches = regEx.Execute(strng) ' 執行搜索。 For Each Match In Matches ' 遍歷匹配集合。 On Error Resume Next RetStr = RetStr & Match.Value&"|" Next RegExpTest = RetStr End Function
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 End Function