Skip to main content
Checks whether a text pattern matches a regular expression string. Returns a BOOLEAN value, specifically false if the text doesn’t match and true if it does match. This is a RE2 regular expression.

Syntax

Parameters

Return Type

BOOLEAN

Examples

Rows: 1Execution time: 5.59ms

Rows: 1Execution time: 15.29ms

Example using a non-constant pattern

The pattern doesn’t have to be a literal. You can match each row against a pattern stored in another column. For example, given a logs table with a message column and a patterns table with a pattern column, return the log messages that match any of the patterns:
To apply flags with a non-constant pattern, embed the flag in the pattern itself using the (?flag) syntax. For example, the following query performs case-insensitive matching:

Example using flags

The i flag causes the regular expression to be case-insensitive. Without this flag, this query would return false as no match is found.

Rows: 1Execution time: 7.11ms