日期:2014-05-17  浏览次数:20843 次

aa[u]baabaa[/u],正则能将[u][/u]间的aa替换成cc吗?
aa[u]baabaa[/u],正则能将[u][/u]间的aa替换成cc吗?

------解决方案--------------------
str = "aa[u]baabaa[/u] "
Set regEx = New RegExp
regEx.Pattern = "\[u\][\s\S]*?aa\[/u\] "
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(str)
For Each Match In Matches
temp = Replace(Match.Value, "aa ", "cc ")
str = Replace(str, Match.Value, temp)
Next
response.write str