What is the equivalent of Regex-replace-with-function-evaluation in Java 7?

Your answer is in the Matcher#appendReplacement documentation. Just put your function call in the while loop. [The appendReplacement method] is intended to be used in a loop together with the appendTail and find methods. The following code, for example, writes one dog two dogs in the yard to the standard-output stream: Pattern p = Pattern.compile(“cat”); … Read more