Identify and replace all parts of a text that match a regular expression, which is a sequence of characters that specifies a search pattern.
Regular Expressions
Application
Text
Inputs (what you have)
Title | Description | Data Type | Required? |
Content | Content containing the value to replace | Text(Long) | Yes |
Regular expression |
| Text(Long) | Yes |
Replace value | The value used as a replacement. If left blank this will cause the found text to be removed. To use a back reference enter the following format '\\{Group Number}' | Text(Long) | No |
Maximum number of replacements |
| Number | No |
Note: the value of inputs can either be a set value in the configuration of the Wrk Action within the Wrkflow, or a variable from the Data library section. These variables in the Data library section are the outputs of previous Wrk Actions in the Wrkflow.
Outputs (what you get)
Title | Description | Data Type | Required |
Edited text | Text with the value replaced | Text(Long) | Yes |
Outcomes
Name | Description |
Success | This status is selected if the pattern was successfully replaced in the text |
Impossible to Complete | This value is selected if we were unable to evaluate the regular expression. |
Examples
Content | Regular expression | Replace Value | Maximum number of replacements | Edited Text |
Hello world |
|
| 1 | Hello Python |
123-45-6789 |
|
|
| --*** |
foo, bar, baz |
|
| 2 | abc, abc, baz |
One: 1, Two: 2, Three: 3 |
|
|
| One: (digit), Two: (digit), Three: (digit) |
Main Street 12345 |
|
| 1 | Main Street ##### |
Email: example@test.com |
|
| 1 | Email: example[at]test[dot]com |
The cat sat on the mat. |
|
|
| The <cat> <sat> on the <mat>. |
2023-03-15 |
|
| 1 | 15/03/2023 |
Firstname Lastname |
|
| 1 | Lastname, Firstname |
"Quote" in a "string" |
|
|
| [Quote] in a [string] |
Apples, Bananas, Cherries, Dates |
|
| 2 | Fruit, Fruit, Cherries, Dates |
โ
Version# 1.0
โ