I don't know whether this is still maintained, but there's a bug when using the Matcher.appendReplacement that removes escaping of characters like "\s". Here's a code example:
Pattern pattern = Pattern.compile("[0-9]");
Matcher matcher = pattern.matcher("12345");
StringBuffer buffer = new StringBuffer();
while (matcher.find()) {
matcher.appendReplacement(buffer, matcher.group() + "\\s");
}
matcher.appendTail(buffer);
System.out.println(buffer);
This should print "1\s2\s3\s4\s5\s" but prints "1s2s3s4s5s".