Replace Filter Dialog Box

This filter replaces a specified substring within the input string with a given text.

The substring to be replaced can be defined by a regular expression.

Note: The component uses the ECMA Script grammar to evaluate regular expressions. For more information, see TR1 Regular Expressions in the MSDN Library.
Option Description
Field name Enter the field name of the FRTN generated by the filter.
Input Enter an input string whose substrings are supposed to be replaced. Commonly, RRT is used in this text box.
Find Enter the substring to search and replace in the input string. If Use regular expression option is selected, then the entered value should be a regular expression.
Note: In the case of using regular expression, the filter generates an error if a regular expression specified in the Find text box is invalid. If the value specified in the Find text box is empty, the filter generates an error in any case of the filter usage.
Replace with Enter a value that will replace found substrings. If Use regular expression option is selected, then the entered value should be a replacement expression. A replacement expression consists of text combined with replace operators, like "$1" or "$2" (which are evaluated as texts that match the capture groups at positions 1 and 2), "$&" (text that matches the entire regular expression), "$$" (the '$' character) and so on.
Match case If this check box is selected, then searching for a substring (or matching a regular expression) is case-sensitive. Otherwise, it is case-insensitive.
Use regular expression If this check box is selected, then the component will consider the text entered in the Find text box as a regular expression and consider text entered in the Replace with text box as a replacement expression. If this check box is not selected, the component will consider the text entered in these text boxes as text strings.
Test Click this button to test the specified regular expression in the Test Regular Expression dialog box. This button is enabled only if the Use regular expression check box is selected.
Fail job if input/output is invalid If this check box is selected the component will reject the current job if either the input string or the replacement result is empty.

This filter generates a special boolean RRT ~DFT::%field name#IsEmpty%~. This RRT is replaced with TRUE if the filter's result is empty. Otherwise, it is replaced with FALSE.

Result RRT:

~DFT::%field name%~ contains the replacement result.

The examples of the filter usage:

Example 1

Input: Press <key> to run help. <key> is a function key.

Find: <key>

Replace with: F1

Match case: unselected

Use regular expression: unselected

The generated RRT will be replaced with: Press F1 to run help. F1 is a function key.

Example 2

Input: Password is 123. User name is 567.

Find: ([^0-9]+)[0-9]+([^0-9]+)[0-9]+([^0-9]+)

Replace with: $1###$2###$3

Match case: unselected

Use regular expression: selected

The generated RRT will be replaced with: Password is ###. User name is ###.