Operators’ precedence and parenthesis

Build 1501 on 14/Nov/2017  This topic last edited on: 19/Jun/2014, at 10:04

The operators’ precedence is:

phrase (/. . ./) and suffixes (^, +, *)

near, before

and, and not

or

i.e. operators higher in the list are executed before operators in a lower position.

This means that in

Biden or Obama and president

‘Obama and president’ is evaluated first, and the result is combined with ‘Biden’ – i.e. the expression matches texts containing either ‘Biden’ or both ‘Obama’ and ‘president’.

Use parenthesis to alter the evaluation order, so

(Biden or Obama) and president

evaluates first ‘Biden or Obama’ and the result is combined with ‘president’ – i.e. the expression matches texts containing both ‘president’ and ‘Biden’ or ‘Obama’.