How to: Use the REGEXMATCH Regular Expression Formula

Prev Next

Learn how to use the REGEXMATCH formula in a Data Workflow component to validate an email address value being submitted by an end-user. You’ll also configure logic that disables a submission button by default, then enables it once the end-user enters a valid email format.

Discover more about regex in our Using Regex in Unqork article.

Configure the End-User Components

For this example, configure an Email component where users enter their email address. Then, configure a Button component to submit the data. Later, you’ll configure a Data Workflow component to enable or disable the submission button based on the validity of the email.

Configure the Email Component

First, configure an Email component to accept an email.

  1. In the Module Builder, drag and drop an Email component onto your canvas.

  2. In the Property ID field, enter email.

  3. In the Label Text field, enter Email.

  4. Click Save Component.

Configure the Button Component

Configure a Button component to be initially disabled. Later, we’ll use a Data Workflow to enable the button if a valid email address is entered in the Email component.

  1. Drag and drop a Button component onto your canvas, placing it below the Email component.

  2. In the Property ID field, enter btnSubmitEmail.

  3. In the Label Text field, enter Submit Email.

  4. Set Disable User Input to A toggle switch indicating an on/off state for a user interface element. (ON). This ensures that the end-user cannot select the button before entering an email address.

  5. Set Restrict to Single Click to A toggle switch indicating an on/off state for a user interface element. (ON). This prevents users from accidentally submitting their data multiple times.

  6. Click Save Component.

While you can use the Regular Expression Pattern settings in the Email component to validate entries, these settings only notify the end-user if their email is invalid. It does not control the status of the button. To control the visibility of the button, use the Data Workflow to control the Regex.

Configure the Data Workflow Component

Add and configure a Data Workflow component to use a REGEXMATCH function to verify the address entered in the email Email component field. Use a Branch Split operator to enable or disable the btnSubmitEmail Button component depending on the Boolean value returned by the REGEXMATCH function.

  1. Drag and drop a Data Workflow component onto your canvas, placing it above the Button component.

  2. In the Property ID and Canvas Label Text fields, enter dwfCheckEmail.

  3. Navigate to the Actions settings.

  4. Set the Trigger Type as Watch.

Configure the Input Operator

To begin the Data Workflow, use an Input operator to bring in data from your Email component.

  1. Drag and drop an Input operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Component

    email

    Required

    Yes

    Source

    Default

Configure the Formula Operator

Add a Formula operator with the following expression: =REGEXMATCH(A1, "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"). You get this expression by using the REGEXMATCH syntax of REGEXMATCH(stringToCheck,regularExpression). But your formula replaces the stringToCheck syntax with A. Doing so retrieves data from the operator's input port. Then, replaces regularExpression with the email validation Regex.

Your organization’s standards might require a different Regex for validation.

  1. Drag and drop a Formula operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Formula Value

    Label

    REGEXMATCH

    Preserve Argument Type

    (unchecked)

    Formula/Expression

    =REGEXMATCH(A1, "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$")

  3. Connect the output port (right) of the Input operator to the input port (left) of the Formula operator.

Configure the Branch Split Operator

Next, use a Branch Split operator to create two paths. If the Formula operator determines the email is valid, the Branch Split operator sends a No value. If the email is invalid, the operator sends a Yes value. Later, you’ll use these values to enable or disable the submission button.

  1. Drag and drop a Branch Split operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Branch Start

    Label

    Yes or No Split

    Do Not Sanitize Formula

    (checked)

    Preserve Argument Type

    (unchecked)

    Condition

    A

  3. Connect the output port (right) of the REGEXMATCH Formula Value operator to the input port (left) of the Yes or No Split Branch Split operator.

Configure the First Create Value Operator

Each branch from the Branch Split operator leads to a Create Value operator depending on the REGEXMATCH response. The created value controls the submission button’s Enable or Disable state.

  1. Drag and drop a Create Value operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Create Value

    Label

    Yes Value (Disable)

    Preserve Argument Type

    (unchecked)

    Expression/Value

    ='yes'

  3. Connect the top output port (upper-right) of the Yes or No Split Branch Split operator to the argument port (top) of the Yes Value Create Value operator.

Configure the Second Create Value Operator

  1. Drag and drop a Create Value operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Create Value

    Label

    No Value (Enable)

    Preserve Argument Type

    (unchecked)

    Expression/Value

    ='no'

  3. Connect the bottom output port (lower-right) of the Yes or No Split Branch Split operator to the argument port (top) of the No Value Create Value operator.

Configure the Branch Merge Operator

While the data travels through separate logic pathways based on validation results, both paths must converge to update the same target component. Add a Branch Merge operator to unify these pathways, then connect it to an Output operator linked to your Button component. The Output operator dynamically toggles the button's state based on the incoming value. If the operator receives a value of Yes (invalid email), the button is disabled. If it receives a value of No (valid email), the button is enabled.

  1. Drag and drop a Branch Merge operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

Setting

Value

Category

Branch End

Label

Yes or No Merge

  1. Connect the output port (right) of the Yes Value Create Value operator to the top input port (upper left) of the Yes or No Merge Branch Merge operator.

  2. Connect the output port (right) of the No Value Create Value operator to the bottom input port (lower left) of the Yes or No Merge Branch Merge operator.

Configure the Output Operator

  1. Drag and drop an Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    btnSubmitEmail

    Action

    Disabled

  3. Connect the output port (right) of the Yes or No Merge Branch Merge operator to the input port (left) of the btnSubmitEmail Output operator.

    Data workflow diagram illustrating email input, processing, and output steps.

  4. Click Save Component.

Your completed module looks like the following:

Email input field with validation function and submit button for user input.

Preview your module in Express View and enter an email in the Email field. The Submit Email button remains disabled until a valid email is entered.

Configure the End-User Components

For this example, configure an Email component where users enter their email address. Then, configure a Button component to submit the data. Later, you’ll configure a Data Workflow component to enable or disable the submission button based on the validity of the email.

Configure the Email Component

First, configure an Email component to accept an email.

  1. In the Module Builder, drag and drop an Email component onto your canvas.

  2. In the Property ID field, enter email.

  3. In the Label Text field, enter Email.

  4. Click Save.

Configure the Button Component

Configure a Button component to be initially disabled. Later, we’ll use a Data Workflow to enable the button if a valid email address is entered in the Email component.

  1. Drag and drop a Button component onto your canvas, placing it below the Email component.

  2. In the Property ID field, enter btnSubmitEmail.

  3. In the Label Text field, enter Submit Email.

  4. Set Disable User Input to A toggle switch indicating an on/off state for a user interface element. (ON). This ensures that the end-user cannot select the button before entering an email address.

  5. Set Restrict to Single Click to A toggle switch indicating an on/off state for a user interface element. (ON). This prevents users from accidentally submitting their data multiple times.

  6. Click Save & Close.

While you can use the Regular Expression Pattern settings in the Email component to validate entries, these settings only notify the end-user if their email is invalid. It does not control the status of the button. To control the visibility of the button, use the Data Workflow to control the Regex.

Configure the Data Workflow Component

Add and configure a Data Workflow component to use a REGEXMATCH function to verify the address entered in the email Email component field. Use a Branch Split operator to enable or disable the btnSubmitEmail Button component depending on the Boolean value returned by the REGEXMATCH function.

  1. Drag and drop a Data Workflow component onto your canvas, placing it above the Button component.

  2. In the Property ID and Canvas Label Text fields, enter dwfCheckEmail.

    These are example Property ID and Label Texts. In your use case, enter unique values for these fields.

  3. Navigate to the Actions settings.

  4. Set the Trigger Type to Watch.

Configure the Input Operator

To begin the Data Workflow, use an Input operator to bring in data from your Email component.

  1. Drag and drop an Input operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Component

    email

    Required

    Yes

    Source

    Default

Configure the Formula Operator

Add a Formula operator with the following expression: =REGEXMATCH(A1, "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"). You get this expression by using the REGEXMATCH syntax of REGEXMATCH(stringToCheck,regularExpression). But your formula replaces the stringToCheck syntax with A. Doing so retrieves data from the operator's input port. Then, replaces regularExpression with the email validation Regex.

Your organization’s standards might require a different regex for validation.

  1. Drag and drop a Formula operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Formula Value

    Label

    REGEXMATCH

    Preserve Argument Type

    (unchecked)

    Formula/Expression

    =REGEXMATCH(A1, "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$")

  3. Connect the output port (right) of the Input operator to the input port (left) of the Formula operator.

Configure the Branch Split Operator

Next, use a Branch Split operator to create two paths. If the Formula operator determines the email is valid, the Branch Split operator sends a No value. If the email is invalid, the operator sends a Yes value. Later, you’ll use these values to enable or disable the submission button.

  1. Drag and drop a Branch Split operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Branch Start

    Label

    Yes or No Split

    Do Not Sanitize Formula

    (checked)

    Preserve Argument Type

    (unchecked)

    Condition

    A

  3. Connect the output port (right) of the REGEXMATCH Formula Value operator to the input port (left) of the Yes or No Split Branch Split operator.

Configure the First Create Value Operator

Each branch from the Branch Split operator leads to a Create Value operator depending on the REGEXMATCH response. The created value controls the submission button’s Enable or Disable state.

  1. Drag and drop a Create Value operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Create Value

    Label

    Yes Value (Disable)

    Preserve Argument Type

    (unchecked)

    Expression/Value

    ='yes'

  3. Connect the top output port (upper-right) of the Yes or No Split Branch Split operator to the argument port (top) of the Yes Value Create Value operator.

Configure the Second Create Value Operator

  1. Drag and drop a Create Value operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Create Value

    Label

    No Value (Enable)

    Preserve Argument Type

    (unchecked)

    Expression/Value

    ='no'

  3. Connect the bottom output port (lower-right) of the Yes or No Split Branch Split operator to the argument port (top) of the No Value Create Value operator.

Configure the Branch Merge Operator

While the data travels through separate logic pathways based on validation results, both paths must converge to update the same target component. Add a Branch Merge operator to unify these pathways, then connect it to an Output operator linked to your Button component. The Output operator dynamically toggles the button's state based on the incoming value. If the operator receives a value of Yes (invalid email), the button is disabled. If it receives a value of No (valid email), the button is enabled.

  1. Drag and drop a Branch Merge operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

Setting

Value

Category

Branch End

Label

Yes or No Merge

  1. Connect the output port (right) of the Yes Value Create Value operator to the top input port (upper left) of the Yes or No Merge Branch Merge operator.

  2. Connect the output port (right) of the No Value Create Value operator to the bottom input port (lower left) of the Yes or No Merge Branch Merge operator.

Configure the Output Operator

  1. Drag and drop an Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    btnSubmitEmail

    Action

    Disabled

  3. Connect the output port (right) of the Yes or No Merge Branch Merge operator to the input port (left) of the btnSubmitEmail Output operator.

    Data workflow diagram showing email input, validation, and output processes.

  4. Click Save.

Your completed module looks like the following:

Email input field with validation function and submit button in application interface.

Preview your module in Express View and enter an email in the Email field. The Submit Email button remains disabled until a valid email is entered.