> 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/api/quick-start-guide/tonic-api-generator-assignment/generator-api-reference/generator-api-ref-find-and-replace.md).

# Find and Replace (FindAndReplaceGenerator)

The [Find and Replace](/app/generation/generators/generator-reference/find-and-replace.md) generator replaces all instances of a specified find string with a specified replace string.

## Link object structure <a href="#generator-api-find-and-replace-link-object" id="generator-api-find-and-replace-link-object"></a>

The Find and Replace generator does not support linking or consistency. You cannot configure differential privacy.

The `metadata` object is populated from the [`FindAndReplaceMetadata`](https://app.tonic.ai/apidocs/index.html#/models/FindAndReplaceMetadata) object. The generator-specific configuration includes:

* The find string.
* Whether the find string is a regular expression.
* The replace string.

```json
{
  "schema": "string",
  "table": "string",
  "column": "string",
  "path": "string",  //JSON fields only
  "dataType": "string",  //MongoDB, Amazon DynamoDB, and JSON fields only
  "metadata": {
    "presetId": "string",
    "generatorId": "FindAndReplaceGenerator",
    "find": "string",
    "useRegex": boolean
    "replace": "string",
    "encryptionProcessor": "x-on", //To use configured Structural data encryption
    "customValueProcessor": "string"  //If custom value processor applied
  }
}
```

## Example replacement <a href="#generator-api-find-and-replace-replacement" id="generator-api-find-and-replace-replacement"></a>

In this example replacement for the Find and Replace generator, the value `yes` is replaced by the value `no`. The find string is not a regular expression.

```json
{
  "name": "workclass",
  "schema": "public",
  "table": "training_classes",
  "links": [
    {
      "schema": "public",
      "table": "training_classes",
      "column": "workclass",
      "metadata": {
        "presetId": "FindAndReplaceGenerator",
        "generatorId": "FindAndReplaceGenerator",
        "find": "yes",
        "useRegex": false
        "replace": "no",
      }
    }
  ]
}
```


---

# 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:

```
GET https://docs.tonic.ai/app/api/quick-start-guide/tonic-api-generator-assignment/generator-api-reference/generator-api-ref-find-and-replace.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
