Skip to content

Commit 1cc5925

Browse files
cordovalweaverryan
authored andcommitted
add parenthesis in the example to correct precendence
1 parent 881477c commit 1cc5925

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

components/expression_language/syntax.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,10 @@ Comparison Operators
176176
To test if a string does *not* match a regex, use the logical ``not``
177177
operator in combination with the ``matches`` operator::
178178

179-
$language->evaluate('not "foo" matches "/bar/"'); // returns true
179+
$language->evaluate('not ("foo" matches "/bar/")'); // returns true
180+
181+
You must use parenthesis because the unary operator ``not`` has precedence
182+
over the binary operator ``matches``.
180183

181184
Examples::
182185

0 commit comments

Comments
 (0)