Documentation
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

sql_matches

sql_matches returns whether or not the SQL query matches a particular regular expression pattern.

Syntax

  SQL_MATCHES(<pattern>)
      
      
  SQL_MATCHES((<pattern>), <parameters>)

Arguments

<pattern>
The regular expression pattern to match.
<parameters>
Parameters control the behavior of regular expression. The parameters are the same as Snowflake regular expression parameters.

Returns

TRUE
If the pattern matches the SQL query.
FALSE
If the pattern doesn’t match the SQL query.

Usage Notes

  • The pattern is a covering pattern, the same as Snowflake’s RLIKE.

Examples

SQL_MATCHES('.*\d{2}.*')