Regex Capture

Extract regex capture groups into new columns

What It Does

Regex Capture pulls structured pieces out of a free-text column using a regular expression with capture groups. Each group becomes its own new column. Common uses: ZIP codes, invoice numbers, country codes, domain names. If the pattern doesn't match a row, the capture columns for that row are NULL.

How to Use It

Opening the Panel

Click the + button in the toolbar or press the operation picker, then search for "Regex Capture". It's in the Transform group.

Configuration

FieldTypeRequiredDescription
Source columnColumn selectYesText column to extract from
PatternRegex stringYesDuckDB regex (RE2) with parenthesised capture groups
Output columnsList of namesYesOne name per capture group, in order
SQL generated under the hood
SELECT *, regexp_extract(address, '(\d{5})-(\d{4})', 1) AS zip5, regexp_extract(address, '(\d{5})-(\d{4})', 2) AS zip_plus4 FROM data
Try this operation →

Related Operations