FEEL

matches

FEEL built-in function · FEEL string functions

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.

Parameters

ParameterTypeDescription
inputstringthe string to test
patternstringregular expression (XPath syntax)
flagsstrings, m, i, x flags (optional)

Examples

matches("foobar", "^fo*b")
matches("FOO", "foo", "i")

Edge cases and null handling

matches("abc", "b")

Unanchored: a match anywhere is enough.

matches("abc", "^b$")
matches("abc", "[")

Invalid pattern: null, not false.

matches(null, "a")

Related functions

replace · contains

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