LIKE Operator
AMPS also provides a regular expression comparison operator, LIKE
, to provide regular expression matching on string values. A pattern is used for the right side of the LIKE
operator. A pattern must be provided as a literal, quoted value. For more on regular expressions and the LIKE
comparison operator, please see the section on Regular Expressions.
The string comparison operators described in the section called String Comparison Functions are usually more efficient than equivalent LIKE
expressions, particularly when used to compare multiple literal patterns, or when the only purpose of the regular expression is to perform case-insensitive matching. Use LIKE
operations when it is not practical to represent the filter condition with the string comparison operators.
LIKE
The string to be compared
The pattern to evaluate the string against
Case-sensitive
Returns true if the string to be compared matches the pattern.
For example, the following filter uses a PCRE backreference to return true for any message where the /state
field contains two identical characters in a row.
This operator is not unicode-aware.
Last updated