62,614
社区成员
发帖
与我相关
我的任务
分享
while(m.find()) {
s = processSpecialChar(rm.reset(m.group()).replaceAll(replacestr));
m.appendReplacement(sb1, s);
}
private String processSpecialChar(String str) {
if(str.indexOf('\\') > -1) {
str = str.replace("\\", "\\\\");
}
if(str.indexOf('$') > -1) {
str = str.replace("$", "\\$");
}
return str;
}