Membership test

Syntax

…expr… IN …expr…

Typing

t, t[] -> BOOL

t, t[n] -> BOOL

STRING, STRING -> BOOL

IP, CIDR -> BOOL

Description

Test if the first operand is a member of the second one.

The second operand can be either an array or vector, a STRING (in which case the first operand must be a string and s substring search will be performed) or a CIDR (in which case the first operand must be an IP address).

Examples

expression evaluates to
42 IN [1; 2; 3] FALSE
"oo" IN "foobar" TRUE
192.168.10.21 IN 192.168.00.0/16 TRUE