Checking that a variable exists in the context
defined
{{ A is defined }}, A exists Result: True.
{{ A is defined }}, A doesn't exist Result: False.
Checking that a variable does not exist in the context
undefined
{{ A is undefined }}, A exists Result: False.
{{ A is undefined }}, A doesn't exist Result: True.
Checking against regular expression
match
{{ A is match("[regular_expression]") }}
Result:
True if A matches the regular expression; False if A does NOT match the regular expression; False if A is not in string format; False if the regular expression is written incorrectly Important: the check is case sensitive.
Checking that an object is a number
number
Result: True.
Result: False.
Checking that an object is an even number
even
Result: True.
Result: False.
Checking that an object is an odd number
odd
Result: False.
Result: True.
Checking that an object is an integer
integer
Result: True.
Result: False.
Checking that an object is a real number
float
Result: True.
Result: False.
Checking that an object is divisible by a number
divisibleby
{{ A is divisibleby(B) }}
Important:
If A = True and B = 1, then True will be returned, since True is 1, and 1 is divisible by 1. If A = False, then True will be returned, since False is 0, and 0 is divisible by any number (except 0). {{ 4 is divisibleby(2) }} Result: True.
{{ 6 is divisibleby(5) }} Result: False.
{{ 5 is divisibleby(0) }} Result: False.
{{ true is divisibleby(1) }} Result: True.
{{ false is divisibleby(10) }} Result: True.
Checking that an object is a string
string
Result: True.
Result: False.
Checking that a string is lowercase
lower
Result: True.
Result: False.
Result: False.
Checking that a string is in upper case
upper
Result: True.
Result: False.
Result: False.
Checking that an object is a dictionary
mapping
{{ {1:'A', 2:'B', 3:'C'} is mapping }} Result: True.
{{ [1, 2, 3] is mapping }} Result: False.
Checking that an object is a sequence (string, list, or dictionary)
sequence
{{ '12345' is sequence }} Result: True.
{{ [1, 2, 3] is sequence }} Result: True.
{{ {1:'A', 2:'B', 3:'C'} is sequence }} Result: True.
Result: False.
Checking that an object is a boolean
boolean
{{ A is boolean }}, A = true Result: True.
{{ A is boolean }}, A = 4 Result: False.
Checking that an object is true
true
{{ A is true }}, A = true Result: True.
Result: False.
Checking that an object is false
false
{{ A is false }}, A = false Result: True.
Result: False.
Checking that an object does not have a value (the value is None or Null (converted to None during ER parsing))
none
{{ A is none }}, A = none Result: True.
Result: False.
Equality testing (equivalent to the == operator)
eq
Result: True.
Result: False.
Result: False.
Testing for inequality (equivalent to the != operator)
ne
Result: True.
Result: False.
Checking that the first operand is greater than the second (equivalent to the > operator)
gt
Result: True.
Result: False.
Result: True.
Result: False.
Checking that the first operand is greater than or equal to the second (equivalent to the >= operator)
ge
{{ 12.12 is ge 12.1199 }} Result: True.
Result: True.
Result: False.
Checking that the first operand is less than the second (equivalent to the < operator)
lt
Result: True.
Result: False.
Checking that the first operand is less than or equal to the second (equivalent to the <= operator)
le
Result: True.
{{ (-1.11) is le (-1.11) }} Result: True.
Result: False.
Finding the first operand in the second
in
Described here: @Finding the first operand in the second