一、蓝色理想misshjn的Javascript解决法
var string = "aa[code]aabb[/code]";
Response.write(string.replace(/\[code\](.*?)\[\/code\]/g,function($1){return $1.replace(/aa/g,"cc")}));二、CSDN技术社区hookee的VBScript解决法
Dim str,temp
str = "aa[code]aabb[/code]"
Set regEx = New RegExp
regEx.Pattern = "\[code\](.*?)\[\/code\]"
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在此再次向他们表示感谢!
评论(0)
暂无评论。