> 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="/app/api/quick-start-guide/tonic-api-generator-assignment/generator-api-reference/generator-api-ref-array-regex-mask.md"><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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
