Regular expression

Regular expression is a pattern of characters that can be used to find various text sequences. The If Action allows comparing data or text string against Perl-compatible regular expressions (PCRE). Regular expressions allow using special symbols as wildcards, anchors, sub-expressions, repeats and other functions to match text in advanced, non-linear ways.

Automation Workshop allows designing advanced conditional branching by applying regular expressions to dynamic variables, e.g. Action outputs, to find necessary patterns in that data. Even if the text itself is each time slightly different, extracting of particular values might still be possible. When the specified pattern is found, the If Action will execute one branch of Actions rather than another.

See examples below for typical usage of some simple regular expressions:

Regular expression examples:
  • [0-9]{3} - matches the number pattern in a range of 000, 001, 002 … 997, 998, 999.
  • (?:\d[ -]*?){13,16} - matches any sequence of 13 to 16 digits with spaces or dashes in them.
  • <DIV\b[^>]*>(.*?)</DIV> - matches the opening and closing pair of a DIV tag with an optional HTML attributes.
Regular expression in Actions:
  • If Action - used for regex compare functions Matches regular expression, Contains regular expression, Does not match regular expression and Does not contain regular expression.
  • Find and replace text Action - regex can be used when searching and replacing text in a text string.
  • Find text Action - regular expressions can be used when searching for a text in a text string.
Additional notes:
  • Automation Workshop supports regular expression flag modifiers (?imsx-imsx).
    • i - do case-insensitive pattern matching.
    • m - treat string as multiple line.
    • s - treat string as single line.
    • x - extend your pattern's readability by permitting whitespaces.
  • It is possible to use inline comments using (?#this is comment) syntax.
  • Escape characters are supported, for example \x64 stands for a, and \x42 stands for B.
Additional resources:

If you have any questions, please do not hesitate to contact our support team.

© 2001–2019 Febooti Ltd.