Skip to content

Commit

Permalink
add parenthesis in the example to correct precendence
Browse files Browse the repository at this point in the history
  • Loading branch information
cordoval authored and weaverryan committed Mar 11, 2014
1 parent 881477c commit 1cc5925
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/expression_language/syntax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ Comparison Operators
To test if a string does *not* match a regex, use the logical ``not``
operator in combination with the ``matches`` operator::

$language->evaluate('not "foo" matches "/bar/"'); // returns true
$language->evaluate('not ("foo" matches "/bar/")'); // returns true

You must use parenthesis because the unary operator ``not`` has precedence
over the binary operator ``matches``.

Examples::

Expand Down

0 comments on commit 1cc5925

Please sign in to comment.