Skip to main content

Match with RegEx

Sophie avatar
Written by Sophie
Updated over a week ago

Definition and Usage

Search for all matches of a regular expression in a text string. This command allows you to extract specific patterns from text using regular expressions, with options to find either all matches or just the first occurrence.


Parameter Values

Input parameters

Parameter

Description

Possible Values

Required

Options / Notes

Original text

Enter text or select a variable containing a text string

Any text string

Yes

Can use variables

RegEx

Enter a regular expression

Valid regular expression pattern

Yes

Click "Regex tool" for assistance with pattern creation

Match the first result only

Specify whether to match the first result only

True/False

No

When checked, only the first match is returned

Ignore case

Specify whether the replacement is case-insensitive

True/False

No

When checked, the pattern matching ignores letter case

Error handling

Parameter Name

Description

Throw error & stop

When an error occurs, the action will trigger an error and stop the execution of the entire app.

Retry command

If an error occurs, the action will retry the command in an attempt to resolve the issue and continue the process.

Ignore error & continue

When an error occurs, the action will be ignored, and the workflow will continue without interruption.

Variables produced

This action produces a variable that contains the matched text from the regular expression pattern. If multiple matches are found and "Match the first result only" is not selected, the variable will contain a list of all matched text items.


Using Variables in Conditions

You can use variables by inserting them into input fields where the {x} icon is displayed. When working with the output variable from this command, you can use it in subsequent actions such as text manipulation, conditionals, or data extraction steps. The returned variable can be either a single text value (when matching first result only) or a list of text values (when matching all results).


Notes

  • Regular expressions must follow standard regex syntax

  • Invalid regex patterns will cause the action to fail

  • The "Regex tool" button provides a utility to help build and test your regular expressions

  • If no matches are found, the output variable will be empty or contain an empty list

  • For complex pattern matching, consider testing your regex patterns in a dedicated regex testing tool first

Did this answer your question?