regex_replace
host callCapy
function regex_replace(pattern : string, replacement : string, subject : string, opt : any = {}) stringDescription
Use $1 for a numbered capture in replacement. opt.flags takes the flag letters described for regex_match().
Parameters
pattern : regular expression
replacement : replacement text
subject : source text
opt : options map with flags
Return Values
Text with all matches replaced.
Example
Capy
print(regex_replace("([a-z]+)", "<$1>", "capy docs"), "\n")
Output
<capy> <docs>