Skip to main content
Version: 4.17.2

Replace component

The Replace component is used to find and replace text in a message body.

Configuration

The Replace component has the following configuration options:

PropertyDescription
RegexTo match all the text that needs to be replaced.
Multiline flagFind an replace text on multiple lines.
Ignore case flagFind and replace text while ignoring case of text.
Dotall flagDot will match all characters including new line and other special characters. This is also known as 'Single-line' flag.
ReplaceWithTo replace the found text with.
GroupShows up after you filled in a regex and clicked the 'Retrieve Groups & Verify Regex' button. It has a default of all. If the regex has one or more groups you can select which group you want to use to find and replace text.

Regex groups

For more information on groups in regex, please visit the following link: Regex groups

create and evaluate regular expressions (regex)

A great resource to create and evaluate regex is Regex 101.

In the left column:

  • Make sure to set Flavour to Java 8 when creating regex for Dovetail.
  • Set Function to Substitution to see the effect of replacements.

Behaviour

After filling in a regex you can click the 'Retrieve Groups & Verify Regex' button to verify it and retrieve the regex groups. The Group configuration option has a default of 'All'. If the regex has one or more groups you can select which group you want to use to find and replace text or you can leave it on the default the find and replace text for all groups. The button also validates your regex and a message above the button will tell you if it is valid or not.

Remarks

  • Exceptionally, the characters \n (line feed), \r (carriage return) and \t (tab) will be unescaped, allowing these to be introduced in the replaced text. For example, you're able to replace semi-colons with tabs or create a new line whenever the Regex is matched.
  • Escape a space by prepending a slash: \ .