Get Subtext Using Regex Step

The Get Subtext Using Regex step pulls out specific text from a larger text string. It uses regular expressions (regex) to find and grab matching subtexts. Use this step when you need to find patterns in text, like email addresses, phone numbers, or specific codes.

How to Use Get Subtext Using Regex

This step finds all times a pattern shows up in your text and puts them in a list.

  1. Add the Step: Drag and drop the "Get Subtext Using Regex" step into your process.
  2. Set Up Parameters: Fill in the necessary input and output parameters.

Parameters Explained

Step Name (Optional)

  • A custom name for this process step.
  • Example: Extract Emails

Text (Required)

  • The text string where you want to look for subtexts.
  • Example: My contact is user@example.com.

Regex expression (Required)

  • The regular expression pattern to search for in your text.
  • Example: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,} (This regex finds email addresses.)

Destination string array variable (Required)

  • A new or existing string array variable to hold all subtexts the regex finds.
  • Example: foundEmails
  • If the regex finds more than one match, each match becomes an item in this array.

Element count destination variable (Required)

  • A new or existing integer variable to hold the total number of subtexts found.
  • Example: emailCount

Related Articles

Need Help?

Can't find what you're looking for? Join the Robotiq Community to get help from other users and the Robotiq team.

Was this article helpful?