Regular Expression Steps
  • 08 Feb 2023
  • 2 Minutes to read
  • Dark
    Light

Regular Expression Steps

  • Dark
    Light

Article Summary

Overview

Step Details

Introduced in Version---
Last Modified in Version7.12.0
LocationData > Numbers


Regular expressions (Regex) are a sequence of characters that define a pattern. They are used in text validation to determine if a string of input conforms to a particular syntax or pattern, such as a phone number or email format. A regex processor interprets regex patterns, and the results of this interpretation inform the text validation process.


Regular Expression Steps

Regex Does Not Match

The Regex Does Not Match step returns a true or false result if the validated String does not match the Input/Regex Patter. 

Input ParameterDescription
InputString value
PatternRegular expression pattern

Regex Get Matches

The Regex Get Matches step returns a count of matched results against a Regex text validation.

Input ParameterDescription
InputString value
RegexRegular expression pattern


Regex Get Matches Advanced

The Regex Get Matches Advanced step returns a list of matched validations utilizing a Regex pattern, a text input, and additional Regex options if desired.

Input ParameterDescription
InputString value
OptionsAdditional options to use with the Regular Expression. Refer to the Microsoft document to learn about the Regular Expression Options.
PatternRegular Expression


Regex Match

The Regex Match step returns a true or false as the result of Regex validation.

Input ParameterDescription
InputString value
PatternRegular Expression pattern


Regex Replace

The Regex Replace step looks up text input by the Regular Expression pattern and replaces text that matches the pattern.

Input ParameterDescription
InputString value
OptionsAdditional options for the Regular Expression. Refer to the Microsoft document to learn about the Regular Expression Options.
PatternRegular Expression pattern
ReplacementString value to replace input


Regular Expression

The Regular Expression step is used to identify patterns within Strings

Input ParameterDescription
InputString input value



Common Use Case Patterns 

The following Regex Patterns can be used in conjunction with the Regex Match step to perform some common text validation. For further information on Regular Expressions and how to configure them see: Microsoft: Regular Expression Language Quick Reference.
Type of ValidationRegex Pattern 
Email^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$
Routing Number^((0[0-9])|(1[0-2])|(2[1-9])|(3[0-2])|(6[1-9])|(7[0-2])|80)([0-9]{7})$
Phone Number\(?\d{3}\)?-? *\d{3}-? *-?\d{4}
String (Only Numbers)^[0-9]+$
Zip Code^\d{5}(?:[-\s]\d{4})?$

Regex Match Example

The following example demonstrates the Regex Match step to see if a user inputted String is a zip code.

  1. Create a Flow
  2. Create a Form that takes in a user input using a Textbox control.
  3. Define a Data Name for the Textbox control
  4. In the Toolbox, expand Data > Text and place the Regex Match step onto the workspace.
  5. For the steps inputs, select the Form's output for the Input field and set Pattern as a constant.
    Since a regular expression for zip code is being used, the following pattern was used: ^\d{5}(?:[-\s]\d{4})?$
  6. Add a Show Popup step to the outcome paths of the Regex Match step.
  7. The inputs can be defined as a Constant for the Show Popup step
  8. Debug the Flow. The pattern and the inputted String will determine the outcome path of the Flow.

For further information on Flows, visit the Decisions Forum.

Was this article helpful?