String Replacer

This node replaces strings in a selected target column. In the configuration dialog, a pattern and a replacement text are specified. If the pattern doesn't match, the result string equals the input string. You can choose to modify strings in-place or add the result strings to a new column.

Options

Target column
Select the column in which the strings should be replaced.
Pattern type
Select the type of pattern which you want to use.
  • Literal matches the pattern as is.
  • Wildcard matches * to zero or more arbitrary characters and matches ? to any single character.
  • Regular expression matches using the full functionality of Java regular expressions, including backreferences in the replacement text. See the Java API for details.
Use backslash as escape character
Only relevant for wildcard matching. If checked, the backslash character can be used to escape special characters. For instance, \? will match the literal character ? instead of an arbitrary character. In order to match a backslash you need to escape the backslash, too (\\).
Case sensitive
If checked, the matching will distinguish between upper and lower case letters.
Pattern
A literal string, wildcard pattern or regular expression, depending on the pattern type selected above.
Replacement text
The text that replaces that previous value in the cell if the pattern matched it. If you are using a regular expression, you may also use backreferences (e.g. $1 to refer to the first capture group, named capture groups can also be used with (?<group>) and ${group} to refer to them).
Replacement strategy
Select what to replace in case a string matches a pattern.
  • Whole string replaces the entire string with the replacement string, requiring an exact match of the whole string.
  • All occurrences replaces all occurrences of the pattern with the replacement string. Note that when e.g. matching on the RegEx-pattern '.*', an empty string at the end of the input is also matched and replaced. To avoid that, use e.g. the pattern '^.*' to indicate that the match has to start at the beginning.
Append new column
If enabled, the strings will not be replaced in-place but a new column is appended that contains the original string with the replacement applied.
New column name
The name of the created column with replaced strings, only relevant if Append new column is enabled.

Input Ports

Icon
The input table contains the string column to perform the replacement on.

Output Ports

Icon
Input table with updated string column or an additional column.

Views

This node has no views

Workflows

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.