Substitute
Arguments
Explanation
Matches all occurences of value
, with replacement
.
value
value
If value is a string. It is matched as appears in the string gloablly, it is not converted to a regular expression.
A regular expression's capture groups are passed to the replacement if applicable.
String replacements
If the replacement is a string, the following charcater sequences have special behavior:
Function replacements
If the replacement is a function, the capture groups are passed in the format ( c1, c2, ..., cn )
. The function should return string, otherwise an error will be thrown
Examples
Last updated