replace
FEEL built-in function · String functions
replace(input, pattern, replacement, flags?)
Returns the input with every match of the regular expression replaced by the replacement, which may reference capture groups as $1, $2, ….
Parameters
| Parameter | Type | Description |
|---|---|---|
| input | string | the source string |
| pattern | string | regular expression to replace (XPath syntax) |
| replacement | string | replacement text; $1…$n reference capture groups |
| flags | string | s, m, i, x flags (optional) |
Examples
replace("banana", "a", "o")
bonono
Try it →
replace("abcd", "(ab)|(a)", "[1=$1][2=$2]")
[1=ab][2=]cd
Try it →
Related functions
Defined by the OMG DMN 1.6 specification, chapter 10.3.4 (built-in functions).