Group 0, the default, is the whole match; 1 is the first ( ). No match gives empty. The pattern is RE2's, as Google Sheets' and Airtable's: no backreferences, no lookaround. Flags, the last argument: "i" for any case, "m" for ^ and $ at each line, "s" for . to take a new line; or (?i) at the pattern's start.

Syntax

regexExtract(text, pattern, group?, flags?)

Arguments marked ? are optional. An ellipsis (…) allows more arguments.

Try an example

regexExtract(Title, "#(\d+)", 1)

Returns empty (text).

Your turnAn example, separate from your shelf
Change the example note’s properties

Run the expression to see its result here.

Date examples use 9 October 2026, 12:00 UTC. Examples run in your browser using Shelf’s formula engine.

Use it in your library

The example names the sample note’s properties. In the app, the formula editor shows the same example with your library’s own properties. Write a property name with spaces as prop("Target words"). The formula language reference explains values, operators, and lists.

Browse all functions