PROCESIO
OverviewPlatform ActionsIntegrations & DemosMarketplaceCustom ActionsDeveloperโ€™s Guide

RegEx Replace

Replaces every part of a text that matches a regular expression.

RegEx Replace replaces every part of a text that matches a regular expression (RegEx). Use it when the text to replace follows a pattern rather than being a fixed value: mask all digits, remove every email address, or reorder the parts of a date.

Add the action

In the Process Designer toolbox, open String, then RegEx, and pick RegEx Replace (or type RegEx Replace in the search box). In the step's properties, click RegEx configuration to open the panel with the fields below.

The RegEx Replace action properties with the RegEx configuration button

Inputs and outputs

FieldDirectionTypeRequiredWhat to put / what you get
String to search inInputTextYesThe text to change.
RegEx expressionInputTextYesThe regular expression, written without delimiters (no /.../).
Replace withInputTextNoThe replacement text. It can refer to groups of the match: $1, $2โ€ฆ or ${name} for a named group. Leave it empty to delete every match.
Ignore caseInputBoolean (true/false)NoTicked by default: uppercase and lowercase letters are treated as equal. Untick it for a case-sensitive replace, or when your expression uses lookarounds or backreferences (see below).
Output stringOutputTextYesThe text after all replacements.

Example

String to search inRegEx expressionReplace withIgnore caseOutput string
Call 0722 123 456 or 0733-999-000\d#offCall #### ### ### or ####-###-###
2024-11-10(\d{4})-(\d{2})-(\d{2})$3.$2.$1on10.11.2024
2024-11-10(?<y>\d{4})-(?<m>\d{2})-(?<d>\d{2})${d}/${m}/${y}off10/11/2024
price 10\d+$$$0offprice $10
a1b2c3\d(empty)offabc
Cat cat CATcatdogoffCat dog CAT
Cat cat CATcatdogondog dog dog

Good to know

  • Every match is replaced, not only the first.
  • The RegEx syntax is the .NET flavour, including $1 / ${name} in the replacement. Write $$ for a literal dollar sign and $0 for the whole match.
  • With Ignore case ticked, lookarounds and backreferences are not supported. Expressions with (?=...), (?!...), (?<=...), (?<!...) or \1 fail the step with a message that starts with "RegexOptions.NonBacktracking is not supported in conjunction with expressions containingโ€ฆ". Untick Ignore case for these expressions.
  • An empty text gives an empty result. An invalid expression fails the step.
  • To replace a fixed text, Replace is simpler: no characters need escaping.

On this page