当字符串方法replaceAll()中替换字符含有特殊字符$如,String test = "<StreamingNo>abc</StreamingNo>"; test = test.replaceAll("abc", "1111111111$$");会报异常,解决方法为改写以下形式:test = test.replaceAll("abc", java.util.regex.Matcher.quoteReplacement("dXNlcjM1NDk2NQ$$"));参考:http://cuisuqiang.iteye.com/blog/2062173