Exception in thread "main" java.lang.IllegalArgumentException: Illegal group reference
at java.util.regex.Matcher.appendReplacement(Matcher.java:857)
at java.util.regex.Matcher.replaceAll(Matcher.java:955)
at java.lang.String.replaceAll(String.java:2223)
这个是因为要替换的值含有“$”符号,处理一下
value = java.util.regex.Matcher.quoteReplacement(value);
方法源码
标签:regex,JAVA,reference,Matcher,replaceAll,报错,Illegal,java From: https://www.cnblogs.com/pxblog/p/17859804.html