The appendTail(StringBuffer sb) method

This method reads characters from the input sequence, starting at the append position, and appends them to the given string buffer. It is intended to be invoked after one or more invocations of the appendReplacement method in order to copy the remainder of the input sequence.

Just like in the case of the appendReplacement() method, there is also an overloaded version of the appendTail() method that accepts StringBuilder, which is not synchronized, instead of StringBuffer, which is synchronized.

Get Java 9 Regular Expressions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.