Skip to main content

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.

Replace First​

Replaces only the first occurrence of the search text.

Inputs​

NameTypeRequiredDescription
Base TexttexttrueThe original text to search within
Search TexttexttrueThe substring to find
Replacement TexttexttrueThe text to replace the match with

Outputs​

NameTypeDescription
Output TexttextThe resulting text after replacement

Output Event Triggers​

Name
Success
Error

Replace All​

Replaces all occurrences of the search text.

Inputs​

NameTypeRequiredDescription
Base TexttexttrueThe original text to search within
Search TexttexttrueThe substring to find
Replacement TexttexttrueThe text to replace all matches with

Outputs​

NameTypeDescription
Output TexttextThe 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​

NameTypeRequiredDescription
Base TexttexttrueThe original text to search within
PatterntexttrueThe regular expression pattern to match
Replacement TexttexttrueThe replacement text

Outputs​

NameTypeDescription
Output TexttextThe resulting text after replacement

Output Event Triggers​

Name
Success
Error