REGEXP

functionsupportedCore SQL functions

docs.snowflake.com ↗

String functions (regular expressions)

Performs a comparison to determine whether a string matches or does not match a specified pattern. Both inputs must be text expressions. REGEXP is similar to the [ NOT ] LIKE function, but with POSIX extended regular expressions instead of SQL LIKE pattern syntax. It supports more complex matching conditions than LIKE. Tip You can use the search optimization service to improve the performance of queries that call this function. For details, see Search optimization service. Aliases: [ NOT ] RLIKE (2nd syntax) See also: String functions (regular expressions) REGEXP_COUNT , REGEXP_INSTR , REGEXP_REPLACE , REGEXP_SUBSTR [ NOT ] ILIKE , [ NOT ] LIKE

Syntax

<subject> [ NOT ] REGEXP <pattern>

Parameters

NameRequiredDescription
subjectrequiredThe string to search for matches.
patternrequiredPattern to match. For guidelines on specifying patterns, see String functions (regular expressions).

Returns

Returns a BOOLEAN or NULL. - When REGEXP is specified, the value is TRUE if there is a match. Otherwise, returns FALSE. - When NOT REGEXP is specified, the value is TRUE if there is no match. Otherwise, returns FALSE. - When either REGEXP or NOT REGEXP is specified, returns NULL if any argument is NULL.

Usage notes

Collation Details

Arguments with collation specifications currently aren’t supported.