Replaces capture references in a replacement string with actual capture values
The placeholder string, may contain <1>, <2>, ... for captures
<1>
<2>
Array of captured substrings
The replaced string
If the replacement pattern is invalid
replace('foo <1>', ['baz', 'bar']) // returns 'foo baz'replace('Hello <> <>!', ['beautiful', 'world']) // returns 'Hello beautiful world!'replace('<1> <1> <1>', ['string']) // returns 'string string string' Copy
replace('foo <1>', ['baz', 'bar']) // returns 'foo baz'replace('Hello <> <>!', ['beautiful', 'world']) // returns 'Hello beautiful world!'replace('<1> <1> <1>', ['string']) // returns 'string string string'
Replaces capture references in a replacement string with actual capture values