Regular Expression

The Regular Expression action runs a regular expression on a value. A regular expression is a sequence of characters that define a search pattern. There are many online resources available that explain how to write a regular expression including RegExr and Regular Expressions 101. This is an advanced action designed for programmers familiar with using regular expressions.

Example: 

Text value:

Hello *Nintex RPA LE*! This is a *Test* string!

Test expression:

\*([\w\s]+)\*

If you set the expression to use the replace method and you give Nintex Bot a word to replace the matches with, like REPLACED, the resulting string is stored in the variable as this:

Hello REPLACED! This is a REPLACED string!

Note: The Actions Quick Reference provides a complete list of actions that you can print for easy reference.

Creating a Regular Expression action

  1. Click the Advanced action group and then select the Regular Expression action to display the Action Builder.

  2. Specify the Value to be parsed with a regular expression.

  3. Type the Expression to be used to parse the value.

  4. Select the method:

    • Match
    • Replace
  5. If you selected Match, select your sub method:
    • All matches
    • First match
    • Last match
    • Match Count
    • Exact Count
  6. If you selected Replace, specify what to replace all matches with.

  7. Select whether to save the output to:

    • List
    • Variable
  8. If you selected List, type the name of the list to create.

  9. If you selected Variable, specify where the results should be stored.

  10. (Optional) Add Notes to the action to document any special instructions or functionality.

  11. Toggle the run switch to Run and click OK to execute and save the action.

    Note: The run switch is set to Run by default. To create or modify this action without executing it, click the slider to change the option to Don't Run.  For more information, go to Action Builder.