Replaces group-name properties (e.g.,
${named}
) in a replacement pattern with the equivalent reference that uses the corresponding group index (e.g.,
$2
). If the string contains literal "$", it must be escaped with slash or else this call will attempt to parse it as a group-name property. This is meant to be used to transform the parameter for:
- {@link Matcher#replaceAll(String)}
- {@link Matcher#replaceFirst(String)}
- {@link Matcher#appendReplacement(StringBuffer,String)}
@param replacementPattern the input string to be evaluated
@return the modified string
@throws PatternSyntaxException group name was not found