不错呦!smile@林凯西,确保“准备文件”中的几个文件都有安装,S...您好,看了您这篇帖子觉得很有帮助。但是有个问题想请...我的修改过了怎么还被恶意注册呢 @jjjjiiii 用PJ快9年了,主要是A...PJ3啊,貌似很少有人用PJ了,现在不是WP就是z...@332347365,我当时接入时错误码没有-10...楼主,ChkValue值应为-103是什么意思呢?...大哥 你最近能看到我发的信息,请跟我联系,我有个制...
aa[code]aabb[/code],将[code][/code]间的aa替换为cc
编辑:dnawo 日期:2007-07-16
在修改PJBlog时需要一个功能:要求能将aa[code]aabb[/code]字符串[code][/code]之间的aa替换为cc,[code][/code]之外的仍保留原样。想了很久都没解决,上蓝色理想和CSDN上寻求帮助,问题最终才得以解决。下边将代码贴出来和大家共享:
一、蓝色理想misshjn的Javascript解决法
二、CSDN技术社区hookee的VBScript解决法
在此再次向他们表示感谢!
一、蓝色理想misshjn的Javascript解决法
复制内容到剪贴板
程序代码

var string = "aa[code]aabb[/code]";
Response.write(string.replace(/\[code\](.*?)\[\/code\]/g,function($1){return $1.replace(/aa/g,"cc")}));
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
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 | 引用: 0 | 查看次数: 4281
发表评论
请登录后再发表评论!