Pattern matching & replacement

The Replace Pattern operation replaces a user-specified pattern in text with a user-specified text string.

Tomas Larsson avatar
Written by Tomas Larsson
Updated over a week ago

Keywords: pattern matching, pattern replacement, regular expression (regexp)

The Replace Pattern operation replaces a user-specified pattern in the form of a regular expression with a user-specified text string and outputs to a new field.

Step-by-step guide

1. Open the operation configuration window

Select the text that you want to replace in the Schema workbench and click the "Add operation" button at the top of the workspace.
โ€‹

Search for "Replace pattern" or find the operation under "Preprocessing & cleaning" and click it.
โ€‹



2. Name the output text field

Under "Output field name", type the name of the output text field.

3. Define the pattern to replace

Under "Regexp", type the pattern in the form of a regular expression that you want to replace.

4. Define the replacement string

Under "Replace with", type the string that you want to replace the pattern with.

5. Apply the operation

Click "Apply" to run the operation. A new field containing the output text, where the pattern has been replaced, has now been added.

Did this answer your question?