Page History
Page properties |
---|
| |||||||
|
|
|
|
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
On this page
|
UI Text Box | ||||
---|---|---|---|---|
|
The JWT expression parser accepts the most common comparison operators |
as well as logical operators . The main purpose of these operators is to construct complex logical comparisons by linking individual expressions. |
Excerpt |
---|
a
Comparison operatorsThe operators |
, their meaning |
and the applicable data types you can use them with are listed below.
Code Block |
| lower than |
|
1 < 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[1, 1, 2] in [2, 1, 1, 1, 4]
, cardinalities of every single element must match.
|
2 in
|
|
|
|
|
|
|
5 not in
|
|
|
|
|
|
|
|
|
|
|
|
title | Overview of all case ignoring comparison operators |
---|
Info | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
The following comparison operators are applicable to
All operators ignore the case of the characters. |
true
) =~
"HELLO" =~ "Hello"
"up" =~ "UP"
["blue", "red", "green"] =~ ["Blue", "RED", "Green"]
!=~
" HELLO" !=~ "Hello"
"up" !=~ "down"
("up" !=~ "UP") = false
["blue", "red"] !=~ ["Blue", "green"]
["blue", "red"] !=~ ["Red", "BLUE"]
(["blue", "red", "green"] !=~ ["Blue", "RED", "Green"]) = false
~~
"Hello World!" ~~ "world"
, checks whether a string contains a substring. "A small step for a man" ~~ "STEP"
, checks whether a string contains a substring. ["one", "two", "three"] ~~ ["TWO", "One"]
, checks whether a string list contains all the elements of another string list. !~~
"Hello World!" !~~ "bye"
, checks whether a string doesn't contain a substring. "A small step for a man" !~~ "big"
, checks whether a string doesn't contain a substring. ["one", "two", "three"] !~~ ["Four"]
, checks whether a string list doesn't contain one element of another string list. (["one", "two", "three"] !~~ ["TWO"]) = false
in~
"world" in~ "Hello World!"
, checks whether a substring is contained in another string. "STEP" in~ "A small step for a man"
, checks whether a substring is contained in another string. ["TWO", "One"] in~ ["one", "two", "three"]
, checks whether all the elements of a string list are contained in another string list. not in~
"bye" not in~ "Hello World!"
, checks whether a substring is not contained in another string. "big" not in~ "A small step for a man"
, checks whether a substring is not contained in another string. ["Four"] not in~ ["one", "two", "three"]
, checks whether any of the elements of a string list are not contained in another string list. (["TWO"] not in~ ["one", "two", "three"]) = false
any in~
["blue", "violet"] any in~ ["Blue", "Red", "Green"]
["Five", "One"] any in~ ["FOUR", "FIVE", "SIX"]
none in~
["Orange"] any in~ ["red", "blue", "green"]
(["orange"] any in~ ["Red", "Orange"]) = false
title | Applicable data types |
---|
Info |
---|
Below you find a comprehensive matrix of all operators and applicable data types. |
Status | ||||
---|---|---|---|---|
|
Status | ||||
---|---|---|---|---|
|
Status | ||||
---|---|---|---|---|
|
Status subtle true title number list
Status subtle true title text list
Status | ||||
---|---|---|---|---|
|
Status | ||||
---|---|---|---|---|
|
=
!=
<
>
<=
>=
~
!~
in
not in
any in
none in
=~
!=~
~~
!~~
in~
not in~
any in~
none in~
Info | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||
Please be aware the both operators of the respective comparison must have the same data type. The only exceptions are the following:
|
title | Things to remember |
---|
~, !~, in
and not in
can be used for checking a single element (number or text) against a number list or a text list1 in [1, 2, 3]
["blue", "red"] ~ "blue" .
~, !~, in
and not in
when used with a text are useful to look for substrings in another string."I love coding" ~ "love"
"I don't like Mondays" !~ "Fridays"
"love" in "I love coding"
"Fridays" not in "I don't like Mondays".
~, !~, in
and not in
respect cardinality, i.e., container list must have at least the same number of elements as contained list.[1, 1] in [1, 1, 1]
[1, 1] not in [1, 2, 3] .
=
and !=
, when used for comparing lists, require to have the same elements, with the same cardinality and the same order.[1, 2, 3] = [1, 2, 3]
[4, 5, 6] != [4, 6, 5] .
Operators <, >, <=
and >=
work according to lexicographical order when comparing strings.
Logical operators
The table below lists all logical operators that can be used for linking logical terms in an expression.
Logical operators take logical terms (which return
Status | ||||
---|---|---|---|---|
|
- a boolean value
- a comparison
- a logical term enclosed by brackets ()
- two logical terms connected with a logical operator, where boolean literals and comparisons themselves are logical terms
Logical operatorsThe table below lists all logical operators that can be used for linking logical terms in an expression. Logical operators take logical terms (which return
Conditional operatorThe conditional operator It basically allows you to construct the following expression: IF logical_expression
|
List operators
Page properties report | ||||||
---|---|---|---|---|---|---|
|
UI Expand | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
If you use multiple operators in a single expression, they will follow a certain order in which they are processed or a precedence.
|
UI Text Box | ||
---|---|---|
| ||
|
Excerpt Include | ||||||
---|---|---|---|---|---|---|
|
title | Overview of all logical operators |
---|
Operator
Meaning
NOT
or !
AND
or &
OR
or |
XOR
a XOR b
is equivalent to a AND !b OR !a AND b
IMPLIES
or IMP
a IMPLIES b
is equivalent to !a OR b
XNOR
or EQV
a EQV b
is equivalent to a IMPLIES b AND b IMPLIES a
Info |
---|
A single logical term can be enclosed by brackets () in order to increase the readability of the expressions or to define a precedence which differs from the given one. Logical operators can also be written in lower case (e.g. |
Conditional operator (IF - THEN -ELSE)
Logical operators
The table below lists all logical operators that can be used for linking logical terms in an expression.