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
| Parameter | Type | Description |
|---|---|---|
| input | string | the string to test |
| pattern | string | regular expression (XPath syntax) |
| flags | string | s, m, i, x flags (optional) |
Examples
matches("foobar", "^fo*b")
true
Try it ↑
matches("FOO", "foo", "i")
true
Try it ↑
Edge cases and null handling
matches("abc", "^b$")
false
Try it ↑
matches(null, "a")
null
Try it ↑
Part of FEEL string functions: the rules all of them share, string concatenation, regex pitfalls and every function side by side.
Related functions
Defined by the OMG DMN 1.6 specification, chapter 10.3.4 (built-in functions).