---
schema_version: "1"
id: a497afe6dd0c6e07f3c08eceb6fbb14a78c12be76e3f09836c7aa21ee644255c
title: Check Regex
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/rpa-builder/6.6/toolbox-variable-handling-check-regex.md
canonical_url: https://docs.mulesoft.com/rpa-builder/6.6/toolbox-variable-handling-check-regex
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 3648fbab97b095056eca620010919cf894021b3572ba7af52ad4a7ce11241671
description: MuleSoft Documentation Site
release: "6.6"
latest: false
---
---
product: RPA Builder
version: 6.6
---

# Check Regex

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Use the Check Regex Action Step to search for a text fragment using a regular expression. The text
fragment can be searched for in a variable.

The results of Check Regex provide various Outbound Variables that can processed further in the
Workflow.

An introduction to regular expressions is provided in the section on
[Using Regular Expressions](https://docs.mulesoft.com/rpa-builder/6.6/advanced-concepts-using-regular-expressions).

## Properties

**Check Regex Settings**

- **Input text** Enter the text that the regular expression is to be applied to. This property is
  only displayed if no variable has been specified in the Check Regex wizard as the target of the
  regular expression search.

- **Regex Pattern** Enter the regular expression that you want to use as the basis of the search.

Other Properties that are the same in all Action Steps are described in the section on **Common
Properties**. For reasons of clarity they are not shown here.

## Inbound Variables

- **Regex Pattern**

  The regular expression that you want to use as the basis of the search.

- **Input text**

  The text to which apply the regular expression. This property is only displayed if no variable is
  specified in the Check Regex wizard as the target of the regular expression search.

## Outbound Variables

- **First Match**

  Stores the first match found for the search expression. The text to search is read from beginning
  to end and the first match is given as the output. The output text is truncated to a maximum
  length of 1024 characters. If no matches are found, this variable is empty.

- **IsMatched** (boolean)

  Specifies whether the expression searched for was found.

- **Match Count**

  The number of matches found in the text searched.

- **Number of first line matched**

  The line number of the first line that contains the text searched for.

- **All Matches**

  An array variable that stores all matches of the regular expression. If no matches are found, this
  variable is empty. If only one match is found, the array contains only this element.

## Wizard

**Regex** Enter the regular expression that you want to use as the basis of the search. Instead of
entering the regular expression directly here, you can store it in a variable. Use the pin next to
the **Regex** field to assign a variable.

The regular expression can be modified in the Regex Tester dialog. Enter the text that you want to
use to test the regular expression into the **Test Pattern** field. Click the **Execute Test**
button to run the test. Matches will be highlighted in the **Test Pattern** field. Click the
**Apply** button to transfer the tested regular expression to the Check Regex Action Step. Click the
**Cancel** button to close the Regex Tester and discard any changes.

**Text Pattern** Enter the text that the regular expression should be applied to. Use the Outbound
Variables from Check Regex to determine if matches were found and what form the matches take. The
Text Pattern can either be entered directly or read from the content of a variable. To read from a
variable, click on the pin and select one of the available variables.

**Please note the following with regard to error handling:** An error message will be displayed if,
for example, the Regex syntax is incorrect or an internal error has occurred (e.g. API error).
Conversely, if the regular expression is correct but no matching content is found (match=0), a
warning message is displayed.
