Replace Text
Category: Processing
Description: Searches a piece of text for a specified substring or regular expression pattern and replaces the first match or all matches with new text.
info
The 'Regex Replace' variant uses linear-time RE2 regular expression syntax.
Related Modules
Replace First
Replaces only the first occurrence of the search text.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| Base Text | text | true | The original text to search within |
| Search Text | text | true | The substring to find |
| Replacement Text | text | true | The text to replace the match with |
Outputs
| Name | Type | Description |
|---|---|---|
| Output Text | text | The resulting text after replacement |
Output Event Triggers
| Name |
|---|
| Success |
| Error |
Replace All
Replaces all occurrences of the search text.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| Base Text | text | true | The original text to search within |
| Search Text | text | true | The substring to find |
| Replacement Text | text | true | The text to replace all matches with |
Outputs
| Name | Type | Description |
|---|---|---|
| Output Text | text | The resulting text after replacement |
Output Event Triggers
| Name |
|---|
| Success |
| Error |
Examples
Replace template placeholder
Inputs
-
Base Text:
"Hello {{name}}, welcome {{name}}!" -
Search Text:
"{{name}}" -
Replacement Text:
"Alice"
Outputs
-
Output Text:
"Hello Alice, welcome Alice!"
Regex Replace
Replaces all matches of a regular expression pattern.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| Base Text | text | true | The original text to search within |
| Pattern | text | true | The regular expression pattern to match |
| Replacement Text | text | true | The replacement text |
Outputs
| Name | Type | Description |
|---|---|---|
| Output Text | text | The resulting text after replacement |
Output Event Triggers
| Name |
|---|
| Success |
| Error |