string to search
compiled regular expression to use
format string to generate replacements from, see the format string.
A string of the same type with the first match (if any) replaced. If no match is found returns the input string itself.
assert(replaceFirst("noon", regex("n"), "[$&]") == "[n]oon");
Construct a new string from input by replacing the first match with a string generated from it according to the format specifier.
To replace all matches use replaceAll.