> For the complete documentation index, see [llms.txt](https://docs.tabula.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tabula.io/data-transformation/formulas/string-functions/extract.md).

# Extract

Extracts the specified regular expression patterns from a string to an array

```mathematica
Extract("code: 650-33", "[0-9]{3}", "^", "$") → "650"
Extract("text text", "[o-y]", "[e]", "[xt]") → "x"
Extract("123 056", "[2-5]", "[1]", "[6]") → 2
```

#### Inputs

`Extract(string, searchRegexp, startAfterRegexp, endBeforeRegexp, [index])`

* `string` - Any text value to extract from
* `searchRegexp` - Regular expression to find to
* `startAfterRegexp` - Regular expression to start the search after
* `endBeforeRegexp` - Regular expression to end the search before
* `[index]` - **\[optional**: `O` by default\*\*]\*\*
