> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reelevant.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Extract

> Extract data using a regex pattern

## Overview

The `extract` transformation extracts data from a string using a regular expression. It returns the first capture group match.

## Syntax

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
extract(<variable>, search="")
```

## Parameters

| Parameter  | Type   | Required | Description                                                      |
| ---------- | ------ | -------- | ---------------------------------------------------------------- |
| `variable` | string | Yes      | The string to extract from                                       |
| `search`   | string | Yes      | The regular expression pattern (returns the first capture group) |

## Examples

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
extract(<variable>, search="(\\d+)")
extract(<variable>, search="([A-Z]+)")
```
