in()

Checks whether the evaluated value exists in a later set of evaluated values.

Syntax

in(VAL_EXPR, EXPR[, ...])
Required Parameters
VAL_EXPR
Expression to be evaluated.
EXPR[, ...]
Expressions to be compared with VAL_EXPR by separating them using commas (,). If it matches one of them, the function returns true, and false otherwise.

Usage

  1. Check whether the value of the user_agent field matches one of Internet Explorer, Chrome, Safari, or Firefox.

    in(user_agent, "msie", "chrome", "safari", "firefox")
    
  2. Check whether the value of the user_agent field contains a Google or Yahoo string.

    in(user_agent, "*google*", "*yahoo*")
    
  3. Check whether the level is either 6 or 7.

    in(level, 6, 7)