Function ReplaceTest(patrn, replStr) Dim regEx, str1 ' 建立变量。 str1 = "The quick brown fox jumped over the lazy dog." Set regEx = New RegExp ' 建立正则表达式。 regEx.Pattern = patrn ' 设置模式。 regEx.IgnoreCase = True ' 设置是否区分大小写。 ReplaceTest = regEx.Replace(str1, replStr) ' 作替换。 End Function