# Filter Grammar Operators

The grammar operators are used to construct expressions that can be evaluated to true or false (for filtering) or to an integer or floating point value (for sorting) or to a vector (for counting).

Note: There are some specific constraints and behaviors associated with the sets variable, which is unique because it is a vector of strings (i.e. all of the sets of which the view is a member).

Operator | Notes | When used with sets
--- | --- | ---
~ | String comparison: True if LHS contains RHS. Use 'string' as shorthand for filename ~ 'string' | Returns a second vector of strings in LHS that contain RHS. The returned vector can be evaluated as a Boolean (true if at least one string) or used as a new vector of strings.
in | Floating point within range: True if LHS is within the range specified by RHS. | N/A
and |  |
or |  |
not |  |
< | Natural sort for strings. | Natural sort for strings.
<= |  |
> |  |
>= |  |
= |  | True if the vector of strings contains at least one element that exactly matches the supplied string. Cannot be used to compare two vectors for equality.
!= |  | True if at least one element of the vector does not exactly match the supplied string. This is not the same as not(sets = 'string')
( ) | Precedence |