PROCESIO
OverviewPlatform ActionsIntegrations & DemosMarketplaceCustom ActionsDeveloperโ€™s Guide

RegEx Extract

Returns every part of a text that matches a regular expression, as a list.

RegEx Extract finds every part of a text that matches a regular expression (RegEx) and returns them as a list. Use it to pull all email addresses, order numbers, amounts or dates out of an email body, a document or a log.

Add the action

In the Process Designer toolbox, open String, then RegEx, and pick RegEx Extract (or type RegEx Extract in the search box). In the step's properties, click RegEx configuration to open the panel with the fields below.

The RegEx Extract action properties with the RegEx configuration button

Inputs and outputs

FieldDirectionTypeRequiredWhat to put / what you get
String to extract fromInputTextYesThe text to search.
RegEx expressionInputTextYesThe regular expression, written without delimiters (no /.../).
Ignore caseInputBoolean (true/false)NoTicked by default: uppercase and lowercase letters are treated as equal. Untick it for a case-sensitive search, or when your expression uses lookarounds or backreferences (see below).
List of resultsOutputList of TextYesEvery match, in the order found. An empty list when nothing matches.

Example

String to extract fromRegEx expressionIgnore caseList of results
Codes: AB12, cd34, EF56[A-Z]{2}\d{2}off["AB12", "EF56"]
Codes: AB12, cd34, EF56[A-Z]{2}\d{2}on["AB12", "cd34", "EF56"]
Contact ana@example.com or ION@Example.org today[\w.-]+@[\w-]+\.[a-z]{2,}on["ana@example.com", "ION@Example.org"]
id=12; id=345id=(\d+)off["id=12", "id=345"]
id=12; id=345(?<=id=)\d+off["12", "345"]
Total: 120 EUR, Tax: 20 EUR(?<=: )\d+off["120", "20"]
line1 + new line + line2(?m)^line\d$off["line1", "line2"]
nothing here\d+off[]

Good to know

  • Each result is the whole match, not a group. id=(\d+) returns id=12, not 12. To get only the part you want, leave the rest out of the match with a lookbehind ((?<=id=)\d+, with Ignore case unticked), or clean the results afterwards with Replace.
  • The RegEx syntax is the .NET flavour. ^ and $ match the start and end of the whole text; add (?m) at the start of the expression to make them match at each line.
  • With Ignore case ticked, lookarounds and backreferences are not supported. Expressions with (?=...), (?!...), (?<=...), (?<!...) or \1 fail the step with a message that starts with "RegexOptions.NonBacktracking is not supported in conjunction with expressions containingโ€ฆ". Untick Ignore case for these expressions.
  • An empty text gives an empty list. An invalid expression fails the step.

On this page