# Regular expression

Define your own regular expression (regex) to search the input data with, optionally choosing from a list of pre-defined patterns. Supports extended regex syntax including the 'dot matches all' flag, named capture groups, full unicode coverage (including `\p{}` categories and scripts as well as astral codes) and recursive matching. Regular expression lives in the **Extractors** category of the `fx` menu. See [regular expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions) for format details.

## Parameters

| Parameter                 | Type    | Required | Default             | Description                                                                                                    |
| ------------------------- | ------- | -------- | ------------------- | -------------------------------------------------------------------------------------------------------------- |
| Input                     | string  | yes      | —                   | Value to transform. Previous step output or a literal.                                                         |
| Built in regexes          | string  | no       | —                   | Argument value for this operation.                                                                             |
| Regex                     | string  | no       | —                   | Argument value for this operation.                                                                             |
| Case insensitive          | boolean | no       | `true`              | Enabled by default.                                                                                            |
| ^ and $ match at newlines | boolean | no       | `true`              | Enabled by default.                                                                                            |
| Dot matches all           | boolean | no       | `false`             | Disabled by default.                                                                                           |
| Unicode support           | boolean | no       | `false`             | Disabled by default.                                                                                           |
| Astral support            | boolean | no       | `false`             | Disabled by default.                                                                                           |
| Display total             | boolean | no       | `false`             | Disabled by default.                                                                                           |
| Output format             | string  | no       | `Highlight matches` | Choose one of: `Highlight matches`, `List matches`, `List capture groups`, `List matches with capture groups`. |

`Input` is the primary value (previous step output or a literal).

## Returned value

| Type   | Description                                      |
| ------ | ------------------------------------------------ |
| `html` | Result of the Regular expression transformation. |

## Example

<details>
<summary>Run Regular expression</summary>

Define your own regular expression (regex) to search the input data with, optionally choosing from a list of pre-defined patterns. Adjust optional parameters when the defaults do not match your payload.

1. Set **Input** to the value to transform (previous step output or a literal).

2. Review **Built in regexes**, **Regex**, **Case insensitive**, **^ and $ match at newlines**, **Dot matches all**, and other options and keep defaults unless your format requires otherwise.

3. Confirm **Output value** shows the transformed result.

</details>
