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

ParameterTypeDescription
inputstringthe source string
patternstringregular expression to replace (XPath syntax)
replacementstringreplacement text; $1…$n reference capture groups
flagsstrings, 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

matches · split

Defined by the OMG DMN 1.6 specification, chapter 10.3.4 (built-in functions).