$$replace
Search and replaces a substring in the given input.
Usage​
"$$replace(<find>,<replacement>,[type]):{input}"
Returns​
string
Arguments​
Argument | Type | Values | Required / Default Value | Description |
---|---|---|---|---|
find | string | Yes | Value to search in input string (depends on type , if set to REGEX, should be a regular expression) | |
replacement | string | Yes | Value 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) | |
type | Enum | STRING /FIRST /REGEX /REGEX-FIRST | STRING | Matching 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"