Skip to main content
This function returns the first matching substring in the target value which matches the regular expression pattern. It extracts the item in pos that matches the pattern. The pattern must completely match some parts of str so that the function can return parts needed to be matched in the pattern. If no matches are found, it will return an empty string.

Syntax

Examples



Tip This example uses the Local Climatological Data(LCD) dataset featured in the the database Basics Quick Start. You can load the data and try the example yourself. Given this data:

Return the two sets of digits following the string OVC:

Return only the second set of digits following the string OVC:

Tip The same result could be returned by not wrapping the first set of digits in a matching group () and returning the first group:

keyword

REGEXP_EXTRACT,REGEXP,EXTRACT