---
title: "Replace with Regex"
description: "Local-first visual environment for building and running AI workflows. Build agents visually, deploy anywhere, privacy by design."
canonical: https://docs.nodetool.ai/nodes/nodetool/text/replacewithregex
markdown: https://docs.nodetool.ai/nodes/nodetool/text/replacewithregex.md
product: NodeTool
source: https://github.com/nodetool-ai/nodetool/blob/main/docs/nodes/nodetool/text/replacewithregex.md
---

# Replace with Regex

**Type:** `nodetool.text.RegexReplace`

**Namespace:** `nodetool.text`

## Description

Replace text matching a regex pattern.
    regex, replace, substitute

    Use cases:
    - Clean or standardize text
    - Remove unwanted patterns
    - Transform text formats

## Properties

| Property | Type | Description | Default |
|----------|------|-------------|---------|
| text | `str` | Text to perform replacements on | `` |
| pattern | `str` | Regular expression pattern | `` |
| replacement | `str` | Replacement text | `` |
| count | `int` | Maximum replacements (0 for unlimited) | `0` |

## Outputs

| Output | Type | Description |
|--------|------|-------------|
| output | `str` |  |

## Related Nodes

Browse other nodes in the [nodetool.text](./) namespace.
