Skip to main content

Regex Filter Transform

Regex Filter finds text with a regular expression and replaces every match.

Basic Usage​

To find and replace text:

  1. Select Regex Filter from the transform menu.
  2. Select one or more text columns.
  3. Enter the regular expression in Regex Pattern.
  4. Enter a Replacement, or leave it empty to remove each match.
  5. Select Apply.

Configure and apply the Regex Filter transform

Configuration Options​

Basic Options​

  • Select Column(s): Choose one or more text columns. The list includes only string columns.
  • Regex Pattern: Enter the regular expression you want to match.
  • Replacement: Enter plain text or a regex replacement string, including capture-group references. Leave this empty to remove matches. The workflow UI accepts strings only; callable replacement functions are available only to direct Python callers.
caution

The regex must consume at least one character. Standard execution rejects patterns that can match an empty string, such as .*, a*, or ^$; these patterns could replace text at every character boundary.

tip

Try an unfamiliar pattern on representative values before running it on the full dataset.

Examples​

Example 1: Masking Phone Numbers

Input Dataset:

NamePhone
Alice123-456-7890
Bob(987) 654-3210
Carol555.123.4567

Configuration:

  • Select Column(s): Phone
  • Regex Pattern: \d
  • Replacement: X

Result:

NamePhone
AliceXXX-XXX-XXXX
Bob(XXX) XXX-XXXX
CarolXXX.XXX.XXXX
Example 2: Standardizing Email Domains

Input Dataset:

EmployeeEmail
Johnjohn@oldomain.com
Sarahsarah@anotherdomain.net
Mikemike@olddomain.org

Configuration:

  • Select Column(s): Email
  • Regex Pattern: @.*$
  • Replacement: @newdomain.com

Result:

EmployeeEmail
Johnjohn@newdomain.com
Sarahsarah@newdomain.com
Mikemike@newdomain.com
caution

Preview the result carefully. A broad pattern may replace more text than you intended.

Best Practices​

  1. Use the narrowest practical pattern, and test edge cases such as nulls and empty strings.
  2. Keep the original column if you may need to compare or recover its values.
  3. Add a note for patterns that are difficult to understand from the node configuration alone.