ASP 正则表达式

来源:百度知道 编辑:UC知道 时间:2024/05/15 02:10:50
怎么用表达式把['#%;]替换成其他须要的字符
['#%;]要相对应替换为[’#%;]

Function RegReplace(Str,PatternStr,RepStr)
Dim NewStr,regEx
NewStr = Str
if isnull(NewStr) then
RegReplace = ""
exit function
end if
Set regEx = New RegExp
regEx.IgnoreCase = True
regEx.Global = True
regEx.Pattern=PatternStr
NewStr = regEx.Replace(NewStr,RepStr)
RegReplace = NewStr
end function

Replace函数