Sample usage
Syntax
REGEXP_CONTAINS( X, regular_expression )
Parameters
X
- a field or expression to evaluate.regular_expression
- a regular expression.
Returns
The REGEXP_CONTAINS
function returns Boolean data type values.
Examples
|
|
|
---|---|---|
REGEXP_CONTAINS(Field, 'A') |
|
|
REGEXP_CONTAINS(Field, 'A.\*') |
|
|
REGEXP_CONTAINS(Field, 'AC') |
|
|
Notes
REGEXP_CONTAINS
differs from the similar REGEXP_MATCH
function, which will only match the entire value by default. Thus, REGEXP_CONTAINS(field,"pattern")
is functionally equivalent to REGEXP_MATCH(field,".*pattern.*")
.
Looker Studio uses the RE2 expression syntax. For more details, see Regular Expressions in Looker Studio.
Note that patterns containing escape characters such as \
may require additional escaping in Looker Studio, which can be avoided with the use of raw string literals.