Appends to sb two strings: the text from the append position up to the beginning of the most recent match, and then the replacement with submatch groups substituted for references of the form $n, where n is the group number in decimal. It advances the append position to where
(StringBuffer sb, String replacement)
| 443 | * @throws IndexOutOfBoundsException if replacement refers to an invalid group |
| 444 | */ |
| 445 | public Matcher appendReplacement(StringBuffer sb, String replacement) { |
| 446 | StringBuilder result = new StringBuilder(); |
| 447 | appendReplacement(result, replacement); |
| 448 | sb.append(result); |
| 449 | return this; |
| 450 | } |
| 451 | |
| 452 | /** |
| 453 | * Appends to {@code sb} two strings: the text from the append position up to the beginning of the |