Notification

This article is about Looker Studio. For Looker documentation, visit https://cloud.google.com/looker/docs/intro.

В настоящее время эта страница недоступна на русском языке. Выберите другой язык в нижней части экрана или воспользуйтесь функцией автоматического перевода Google Chrome.

REGEXP_EXTRACT

Returns the first matching substring in the target value which matches the regular expression pattern.

Sample usage

REGEXP_EXTRACT(Campaign , 'TYPE:(.*)')

Syntax

REGEXP_EXTRACT(X, regular_expression)

 

Parameters

  • X - a field or expression that includes a field.
  • regular_expression - a regular expression that extracts a portion of field_expression. regular_expression must contain a valid extraction pattern.

Returns

The REGEXP_EXTRACT function returns text values.

Example

Extract the top-level directory in a URL:

REGEXP_EXTRACT( URL , '^https://[^/]+/([^/]+)/' )

For example, if the URL field contained this page's address, the function above would return looker-studio.

Notes

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.

Эта информация оказалась полезной?

Как можно улучшить эту статью?
true
What's new in Looker Studio?

Learn about new features and recent changes. Looker Studio release notes live on Google Cloud.

Search
Clear search
Close search
Main menu
13623696019957923022
true
Поиск по Справочному центру
true
true
true
true
true
102097
false
false