Public Function RegExpReplace(str1,patrn, replStr,ModeSet)
Dim regEx, Matches ' 建立变量。
Set regEx = New RegExp ' 建立正则表达式。
regEx.Pattern = patrn ' 设置模式。
regEx.IgnoreCase = ModeSet ' 设置是否区分大小写。
regEx.Global=True '搜索是否应用于整个字符串
RegExpReplace = regEx.Replace(str1, replStr) ' 作替换。
Set regex = nothing
End Function