operator =operator =~(t=t=~...)Boolean

Checks that all the items are equal.

Note that you can compare more than two items at once. The equals expression is true only if all the items are equal to each other.

Checks if the value on the left, matches the pattern on the right.

If there are no special patterns on the right-hand side (e.g. _, operator ±, new variables) then it is equivalent to operator =.

If you do declare a variable in the right-hand side, the variable will not be accessible outside the pattern. For that, use the full match expression.

ExamplesClick an example to insert it
1 = 2false
from text("1") = 1true
(2/2)=1=(2-1)true
"$50" =~ ("$" ; _)trueCheck if text starts with a dollar sign
50.0006 =~ (50 ± 0.01)trueCheck if number is close to another
["Hi", "there"] =~ ["", _]falseCheck if a list has two items, and the first is an empty text value
(low:2, high:4) =~ (low:x, high:(x + 2))trueCheck if the high item is exactly 2 higher than the low item
["Bye", "Bye"] =~ [s, s]trueCheck if a list has two values, and they are the same