> For the complete documentation index, see [llms.txt](https://docs.tonic.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tonic.ai/app/generation/generators/generator-reference/array-regex-mask.md).

# Array Regex Mask

This is a [composite generator](/app/generation/generators/generator-types/generators-composite.md).

A version of the [Regex Mask](/app/generation/generators/generator-reference/regex-mask.md) generator that can be used for array values.

Uses regular expressions to parse strings and replace specified substrings with the output of specified generators. The parts of the string to replace are specified inside unnamed top-level capture groups.

## Characteristics <a href="#array-regex-mask-characteristics" id="array-regex-mask-characteristics"></a>

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><strong>Consistency</strong></td><td valign="top">Determined by the selected sub-generators.</td></tr><tr><td valign="top"><strong>Linking</strong></td><td valign="top">Determined by the selected sub-generators.</td></tr><tr><td valign="top"><strong>Differential privacy</strong></td><td valign="top">Determined by the selected sub-generators.</td></tr><tr><td valign="top"><strong>Data-free</strong></td><td valign="top">Determined by the selected sub-generators.</td></tr><tr><td valign="top"><strong>Allowed for primary keys</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Allowed for unique columns</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Uses format-preserving encryption (FPE)</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Privacy ranking</strong></td><td valign="top">5</td></tr><tr><td valign="top"><strong>Generator ID (for the API)</strong></td><td valign="top"><a href="/pages/u95DTjy0veeI9D3Jh05U"><code>ArrayRegexMaskGenerator</code></a></td></tr></tbody></table>

## How to configure <a href="#array-regex-mask-configure" id="array-regex-mask-configure"></a>

### Adding a regular expression <a href="#array-regex-mask-add-regex" id="array-regex-mask-add-regex"></a>

To add a regular expression:

1. Click **Add Regex**.\
   \
   On the configuration panel, **Cell Value** shows a sample value from the source database. You can use the previous and next options to navigate through the values.
2. By default, **Replace all matches** is enabled.\
   \
   To only match the first occurrence of a pattern, toggle **Replace all matches** to the off position.
3. In the **Pattern** field, enter a regular expression.\
   \
   If the expression is valid, then Structural displays the capture groups for the expression.
4. For each capture group, to select and configure the generator to apply, click the selected generator.\
   \
   You cannot select another composite generator.
5. To save the configuration and immediately add a generator for another path expression, click **Save and Add Another**.\
   \
   To save the configuration and close the add generator panel, click **Save**.

### Managing the regular expressions list <a href="#array-regex-mask-manage-regex" id="array-regex-mask-manage-regex"></a>

From the **Regexes** list:

* To edit a regular expression, click the edit icon.
* To remove a regular expression, click the delete icon.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tonic.ai/app/generation/generators/generator-reference/array-regex-mask.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
