FEEL string functions

14 built-in functions · DMN 1.6

FEEL has no methods on strings. Everything you do with text in a DMN decision is a built-in function call or the + operator. This guide covers all of them, with the edge cases that tend to surprise people: positions start at 1 and can be negative, a null argument makes the result null, and three of the functions take a regular expression where you might expect plain text.

Each result on this page was computed by the FEEL engine behind the evaluator at the top. Click Try it to run any example, then change it.

All FEEL string functions at a glance

FunctionSignatureReturns
substringsubstring(string, start position, length?)Returns the part of the string that starts at start position
string lengthstring length(string)Returns the number of characters in the string
upper caseupper case(string)Returns the string with every character converted to upper case
lower caselower case(string)Returns the string with every character converted to lower case
substring beforesubstring before(string, match)Returns everything before the first occurrence of match; the empty string if match does not occur
substring aftersubstring after(string, match)Returns everything after the first occurrence of match; the empty string if match does not occur
containscontains(string, match)Returns true if the string contains match anywhere, false otherwise
starts withstarts with(string, match)Returns true if the string begins with match
ends withends with(string, match)Returns true if the string ends with match
matchesmatches(input, pattern, flags?)Returns true if the input matches the regular expression
replacereplace(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, …
splitsplit(string, delimiter)Splits the string at every match of the delimiter pattern and returns the parts as a list of strings
string joinstring join(list, delimiter?)Concatenates a list of strings into one string, optionally separated by a delimiter
stringstring(from)Converts any FEEL value to its string representation

Rules every string function follows

Positions are 1-based. A negative position counts from the end, so -1 is the last character. DMN 1.6 restricts substring to positions that exist: the start position must not be 0 and must lie within the string, and the length must not run past its end. Outside that range the result is null (Table 75). Some engines are more lenient there, so a portable model does not rely on out-of-range behavior. A fractional position or length is truncated to an integer.

Arguments are not converted. If a string function receives a number, a date or null where it expects a string, the result is null; nothing is turned into a string implicitly. Use string() to convert first.

Comparison is case-sensitive. contains, starts with, ends with and = compare characters exactly. To compare without case, lower-case both sides, or use matches with the i flag.

How substring counts start positions from either end. Each cell is the result of the column expression with that start position.
start positionsubstring("foobar", start)substring("foobar", start, 2)
1foobarfo
3obarob
-2arar
-6foobarfo
substring(123, 1)
returns null Try it ↑

A number is not a string; there is no implicit conversion.

substring(string(123), 1)
returns 123 Try it ↑

Convert first with string().

substring("foobar", 3, 100)
returns null Try it ↑

The length runs past the end of the string.

contains("FooBar", "foo")
returns false Try it ↑

Matching is case-sensitive.

contains(lower case("FooBar"), "foo")
returns true Try it ↑

Lower-case the input to compare without case.

Concatenating strings

FEEL has no concat function for two strings. Use the + operator. To join a list of strings, use string join, which also takes a separator. Neither one converts numbers for you, so wrap numbers and dates in string().

"Hello, " + "world"
returns Hello, world Try it ↑
"Total: " + string(42)
returns Total: 42 Try it ↑

Numbers have to be converted explicitly.

"Total: " + 42
returns null Try it ↑

Without string() the result is null in standard FEEL. B-FEEL converts the number (see the table at the end).

"a" + null
returns null Try it ↑

One null operand makes the whole concatenation null. string join skips null elements instead.

string join(["a", null, "c"], "-")
returns a-c Try it ↑
string join(["Due on", string(date("2026-07-24"))], " ")
returns Due on 2026-07-24 Try it ↑

Regular expressions: matches, replace and split

matches, replace and split take a regular expression in XPath/XQuery syntax, not a plain string. This catches people out most often with ., which matches any character. To match a literal dot, escape it as \\. inside a FEEL string. The FEEL string literal turns \\ into one backslash, and the regex then reads \..

replace("a.b.c", ".", "-")
returns ----- Try it ↑

An unescaped dot matches every character.

replace("a.b.c", "\\.", "-")
returns a-b-c Try it ↑

Escaped, it matches only the dots.

split("a.b.c", "\\.")
returns [a, b, c] Try it ↑
replace("2026-07-24", "(\\d+)-(\\d+)-(\\d+)", "$3.$2.$1")
returns 24.07.2026 Try it ↑

Capture groups are referenced as $1, $2, … in the replacement. This one reformats an ISO date.

matches("abc", "[")
returns null Try it ↑

An invalid pattern gives null, not false.

matches("Invoice", "invoice", "i")
returns true Try it ↑

The i flag matches without regard to case.

Function reference

Each function with its parameters, examples and edge cases.

substring(string, start position, length?)

Returns the part of the string that starts at start position. Without length, it runs to the end of the string; a negative start position counts backwards from the end.

A negative start position counts from the end: -1 is the last character, -3 the third from last. DMN 1.6 defines substring only for positions inside the string: the start position must be non-zero and within [-length..length], and the length must be at least 1 and must not run past the end. Anything else is outside the function's domain, and the result is null. A fractional start position or length is truncated, as for every integer parameter of a built-in.

ParameterTypeDescription
stringstringthe source string
start positionnumber1-based start; negative counts from the end
lengthnumbermaximum characters to return (optional)
substring("foobar", 3)
returns obar Try it ↑
substring("foobar", 3, 3)
returns oba Try it ↑
substring("foobar", -2, 1)
returns a Try it ↑
substring("foobar", -3)
returns bar Try it ↑

Last three characters.

substring("foobar", -2, 2)
returns ar Try it ↑

The last two characters: start at -2, take two.

substring("foobar", 1.5, 2)
returns fo Try it ↑

The fractional start position is truncated to 1.

substring("foobar", 0)
returns null Try it ↑

There is no position 0.

substring("foobar", 10)
returns null Try it ↑

A start position beyond the string is outside the domain. B-FEEL returns the empty string.

substring("foobar", 3, 100)
returns null Try it ↑

So is a length that runs past the end.

substring(null, 1)
returns null Try it ↑

A null input gives null in FEEL; B-FEEL returns the empty string.

Related: substring before · substring after · string length

string length(string)

Returns the number of characters in the string.

The length counts characters (Unicode code points), so accented letters and emoji count as one each. Spaces count too. A non-string argument such as a number gives null; convert it with string() first if you want the length of its text.

ParameterTypeDescription
stringstringthe string to measure
string length("foo")
returns 3 Try it ↑
string length("")
returns 0 Try it ↑
string length("äöü")
returns 3 Try it ↑

Each accented letter counts as one character.

string length("ab😀")
returns 3 Try it ↑

An emoji is one code point, so it counts as one character.

string length(" ")
returns 2 Try it ↑

Whitespace counts.

string length(123)
returns null Try it ↑

Numbers are not converted. B-FEEL returns 0.

string length(string(123))
returns 3 Try it ↑
string length(null)
returns null Try it ↑

Related: substring

upper case(string)

Returns the string with every character converted to upper case.

ParameterTypeDescription
stringstringthe string to convert
upper case("aBc4")
returns ABC4 Try it ↑
upper case("straße")
returns STRASSE Try it ↑

Upper-casing can change the length: ß becomes SS.

upper case(null)
returns null Try it ↑

Related: lower case

lower case(string)

Returns the string with every character converted to lower case.

ParameterTypeDescription
stringstringthe string to convert
lower case("aBc4")
returns abc4 Try it ↑

Related: upper case

substring before(string, match)

Returns everything before the first occurrence of match; the empty string if match does not occur.

ParameterTypeDescription
stringstringthe source string
matchstringthe delimiter to search for
substring before("foobar", "bar")
returns foo Try it ↑
substring before("foobar", "xyz")
returns (empty string) Try it ↑
substring before("a-b-c", "-")
returns a Try it ↑

Only the first occurrence counts.

substring before("foobar", "")
returns (empty string) Try it ↑

Related: substring after · split

substring after(string, match)

Returns everything after the first occurrence of match; the empty string if match does not occur.

ParameterTypeDescription
stringstringthe source string
matchstringthe delimiter to search for
substring after("foobar", "ob")
returns ar Try it ↑
substring after("", "a")
returns (empty string) Try it ↑
substring after("a-b-c", "-")
returns b-c Try it ↑

Everything after the first occurrence, including later delimiters.

substring after("foobar", "")
returns foobar Try it ↑

Related: substring before · split

contains(string, match)

Returns true if the string contains match anywhere, false otherwise.

contains takes a plain string, not a pattern, so a dot is just a dot. To test whether a list contains a value, use list contains instead.

ParameterTypeDescription
stringstringthe string to search in
matchstringthe substring to look for
contains("foobar", "of")
returns false Try it ↑
contains("foobar", "oba")
returns true Try it ↑
contains("FooBar", "foo")
returns false Try it ↑

Case-sensitive.

contains("a.b", ".")
returns true Try it ↑

No regex: the dot is literal.

contains("foobar", "")
returns true Try it ↑

Every string contains the empty string.

contains(null, "a")
returns null Try it ↑

Null in, null out. B-FEEL returns false.

Related: starts with · ends with · matches

starts with(string, match)

Returns true if the string begins with match.

ParameterTypeDescription
stringstringthe string to test
matchstringthe expected prefix
starts with("foobar", "fo")
returns true Try it ↑
starts with("Foobar", "foo")
returns false Try it ↑

Case-sensitive.

starts with("foobar", "")
returns true Try it ↑
starts with(null, "a")
returns null Try it ↑

Related: ends with · contains

ends with(string, match)

Returns true if the string ends with match.

ParameterTypeDescription
stringstringthe string to test
matchstringthe expected suffix
ends with("foobar", "r")
returns true Try it ↑
ends with("file.PDF", ".pdf")
returns false Try it ↑

Case-sensitive, so check file extensions with a lower-cased name.

ends with(lower case("file.PDF"), ".pdf")
returns true Try it ↑

Related: starts with · contains

matches(input, pattern, flags?)

Returns true if the input matches the regular expression. Flags: i for case-insensitive, s for dot-all, m for multi-line, x to ignore whitespace in the pattern.

The pattern only has to match somewhere in the input. Anchor it with ^ and $ to test the whole string.

ParameterTypeDescription
inputstringthe string to test
patternstringregular expression (XPath syntax)
flagsstrings, m, i, x flags (optional)
matches("foobar", "^fo*b")
returns true Try it ↑
matches("FOO", "foo", "i")
returns true Try it ↑
matches("abc", "b")
returns true Try it ↑

Unanchored: a match anywhere is enough.

matches("abc", "^b$")
returns false Try it ↑
matches("abc", "[")
returns null Try it ↑

Invalid pattern: null, not false.

matches(null, "a")
returns null Try it ↑

Related: replace · contains

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, ….

ParameterTypeDescription
inputstringthe source string
patternstringregular expression to replace (XPath syntax)
replacementstringreplacement text; $1…$n reference capture groups
flagsstrings, m, i, x flags (optional)
replace("banana", "a", "o")
returns bonono Try it ↑
replace("abcd", "(ab)|(a)", "[1=$1][2=$2]")
returns [1=ab][2=]cd Try it ↑
replace("a.b.c", ".", "-")
returns ----- Try it ↑

The pattern is a regex; an unescaped dot matches every character.

replace("a.b.c", "\\.", "-")
returns a-b-c Try it ↑
replace("abc", "b", "$")
returns null Try it ↑

A lone $ in the replacement is invalid and gives null.

replace("Hello", "l", "L", "i")
returns HeLLo Try it ↑

Related: matches · split

split(string, delimiter)

Splits the string at every match of the delimiter pattern and returns the parts as a list of strings.

The delimiter is a regular expression. A plain comma or semicolon works as expected, but a dot or a pipe has to be escaped. Empty parts between consecutive delimiters are kept. A pattern such as \\s*,\\s* splits and trims in one step.

ParameterTypeDescription
stringstringthe string to split
delimiterstringregular expression separating the parts
split("John Doe", "\\s")
returns [John, Doe] Try it ↑
split("a;b;c;;", ";")
returns [a, b, c, , ] Try it ↑
split("a.b.c", ".")
returns [, , , , , ] Try it ↑

Unescaped, the dot matches every character, which leaves only empty strings.

split("a.b.c", "\\.")
returns [a, b, c] Try it ↑
split("a,b,,c", ",")
returns [a, b, , c] Try it ↑

Empty parts are kept.

split("a, b ,c", "\\s*,\\s*")
returns [a, b, c] Try it ↑

Split and trim whitespace in one pattern.

split("", ",")
returns [] Try it ↑
split(null, ",")
returns null Try it ↑

B-FEEL returns an empty list.

Related: string join · substring before · substring after

string join(list, delimiter?)

Concatenates a list of strings into one string, optionally separated by a delimiter. Null elements in the list are skipped.

This is the list counterpart of the + operator. Elements must be strings: a list of numbers gives null, so convert with for x in list return string(x) first.

ParameterTypeDescription
listlist of stringsthe strings to concatenate; null elements are ignored
delimiterstringseparator between elements (optional)
string join(["a", "b", "c"], ", ")
returns a, b, c Try it ↑
string join(["a", null, "c"])
returns ac Try it ↑
string join([], ", ")
returns (empty string) Try it ↑
string join([1, 2], ", ")
returns null Try it ↑

Numbers are not converted.

string join(for x in [1, 2] return string(x), ", ")
returns 1, 2 Try it ↑

Related: split · concatenate

string(from)

Converts any FEEL value to its string representation.

ParameterTypeDescription
fromanythe value to render
string(1.1)
returns 1.1 Try it ↑
string(date("2026-07-24"))
returns 2026-07-24 Try it ↑
string([1, 2])
returns [1, 2] Try it ↑
string(null)
returns null Try it ↑

The one value string does not convert. B-FEEL returns the empty string.

Related: number · string join

How B-FEEL differs

In standard FEEL an invalid argument makes the result null. The business-friendly B-FEEL dialect returns a type default instead. Both columns were evaluated by the same engine:

ExpressionFEELB-FEEL
"total: " + 5nulltotal: 5
upper case(null)null(empty string)
contains("abc", null)nullfalse
split(null, ",")null[]

Every result on this page was computed by the Impulse FEEL engine 0.9.1, the interpreter that runs the playground. Last updated .

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