Looker Studio is now called Data Studio. Learn more about this change.

REGEXP_CONTAINS

Sample usage

REGEXP_CONTAINS(Page, 'home')

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

Example formula Input Output
REGEXP_CONTAINS(Field, 'A') ABC123 true
REGEXP_CONTAINS(Field, 'A.\*') ABC123 true
REGEXP_CONTAINS(Field, 'AC') ABC123 false

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.*").

Data Studio uses the RE2 expression syntax. For more details, see Regular Expressions in Data Studio.

Note that patterns containing escape characters such as \ may require additional escaping in Data Studio, which can be avoided with the use of raw string literals.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026年08月26日 UTC.