The REGEXP_REPLACE function replaces text using Google RE2 regular expressions.In this article:
REGEXP_REPLACE(Campaign , 'A_REALLY_LONG_NAME', 'ShortName')
REGEXP_REPLACE(field_expression, regexp, replacement)
field_expression- an field or expression that includes a field
regexp- a regular expression that matches a portion of
replacement- the text with which to replace the matched portion of
- REGEXP_REPLACE uses RE2-style regular expressions.
- The REGEXP_REPLACE function returns
Replace a campaign code with a more readable name:
REGEXP_REPLACE(LOWER(Campaign), ".bc123", "Summer Sale")
This will replace codes like "abc123," "ABC123," "BBC123," etc. with "Summer Sale."