Skip to main content

$$replace

Search and replaces a substring in the given input.

Usage​

"$$replace(<find>,<replacement>,[type]):{input}"

Returns​

string

Arguments​

ArgumentTypeValuesRequired / Default ValueDescription
findstringYesValue to search in input string (depends on type, if set to REGEX, should be a regular expression)
replacementstringYesValue to replace each match (or only first if type = REGEX-FIRST), when using regular expression can use group matches (e.g. $1) (Note: to escape $ if starting with it)
typeEnumSTRING/FIRST/REGEX/REGEX-FIRSTSTRINGMatching type

Examples​

Input

Definition

Output

"hello"
"$$replace(l,x):$"
"hexxo"
"hello"
"$$replace([le],x,REGEX):$"
"hxxxo"
"hello"
"$$replace([le],x,REGEX-FIRST):$"
"hxllo"
"hello"
"$$replace('(ll)',$1i,REGEX):$"
"hellio"