Capy-Bearer Documentation

regex_replace

host call

Capy

function regex_replace(pattern : string, replacement : string, subject : string, flags : string = "") string

Description

Use $1 for a numbered capture in replacement.

Parameters

pattern : regular expression

replacement : replacement text

subject : source text

flags : regular expression flags

Return Values

Text with all matches replaced.

Example

Capy

print(regex_replace("([a-z]+)", "<$1>", "capy docs"), "\n")