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

# Extract Text with Regex

> Find every regex match and return its capture groups.

The **Extract Text with Regex** action searches a string and returns a list of
all matches. Each result contains the complete matched text and a repeatable
list of values captured by parentheses in the pattern.

## Inputs

| Input              | Type               | Required | Description                       |
| ------------------ | ------------------ | -------- | --------------------------------- |
| **Text**           | String             | Yes      | The text to search.               |
| **Search Pattern** | Regular expression | Yes      | The pattern used to find matches. |

## Outputs

| Output             | Type            | Description                                           |
| ------------------ | --------------- | ----------------------------------------------------- |
| **Matches**        | List of objects | Every match, in the order it appears in the text.     |
| **Match**          | String          | The complete text matched by one result.              |
| **Capture Groups** | List of strings | The values captured by the pattern's numbered groups. |

The action finds all matches even if the connected regex does not have the
**Global** flag. Its other flags, such as **Ignore case**, **Multiline**, and
**Dot-all**, are preserved.

## Example: extract invoice details

Create a **Regular Expression** with:

```text theme={null}
Invoice\s+(INV-\d+):\s+\$(\d+(?:\.\d{2})?)
```

For `Invoice INV-1042: $75.50`, the first result contains:

* **Match** — `Invoice INV-1042: $75.50`
* First capture group — `INV-1042`
* Second capture group — `75.50`

Connect the entire **Matches** list when a later action can iterate over it, or
expose individual repeat outputs when you expect a fixed number of matches.

<Note>
  If the pattern has no capture groups, each result still has **Match**, while
  **Capture Groups** is empty. If nothing matches, **Matches** is an empty list.
</Note>
