Notification

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

Trang bạn đã yêu cầu hiện không có sẵn bằng ngôn ngữ của bạn. Bạn có thể chọn ngôn ngữ khác ở cuối trang hoặc dịch nhanh mọi trang web sang ngôn ngữ mà bạn chọn bằng cách sử dụng tính năng dịch được tích hợp sẵn trong 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 X. regular_expression must contain a valid extraction pattern.

Returns

The REGEXP_EXTRACT function returns text values.

Example

Example formula Input Output
REGEXP_EXTRACT( URL , '^https://[^/]+/([^/]+)/' ) https://support.google.com/looker-studio/answer/7050487 looker-studio
REGEXP_EXTRACT( URL , '^https://[^/]+/([^/]+)/' ) https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators bigquery

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.

Thông tin này có hữu ích không?

Chúng tôi có thể cải thiện trang này bằng cách nào?
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
10012495893430547872
true
Tìm kiếm trong Trung tâm trợ giúp
true
true
true
true
true
102097
false
false