Skip to content

RegexpExtract

Description

RegexpExtract extracts text that matches a regular expression.

Syntax

RegexpExtract(text, pattern[, group_index])

Parameters

Parameter Required Type Description
text Yes String, field, or expression Source text.
pattern Yes String Regular expression pattern.
group_index No Integer Capture group index to return.

Notes

Use this function in calculated fields, metric expressions, or query expressions where the function category is supported.

Example

RegexpExtract(ProductCode, "([A-Z]+)", 1)

The expression returns the calculated result according to the current query context.