Reading time: 6 min
Flows
Updated on: 15/01/2026
Quick setup checklist
Use this checklist to diagnose an invalid regex rule and replace it with a working (or simpler) matching rule.
Regular Expressions (regex) are used to create advanced, flexible matching rules in flows. They allow you to match patterns rather than exact values, which is useful for validating inputs such as IDs, codes, formats, or free-text responses.
Regex is typically used in:
- Wait for Response rules
- Split by Expression or Split by Rule logic
- Advanced validation of free-text responses
Tip: Only use regex when simpler rule types (equals, contains, has any of these words) are not sufficient.
Because regex follows a strict syntax, even a small mistake can cause a rule to be marked as invalid.
A regular expression becomes invalid when it:
- Does not follow correct syntax
- Contains unmatched characters
- Uses unsupported constructs
- Is improperly escaped
Important: An invalid regex will prevent the rule from working as expected and may block contacts from progressing in the flow.
[CAPTURE: Show a rule editor highlighting an invalid regex warning or error state.]
The platform uses Perl-style regular expressions for pattern matching. This means common constructs such as character classes, anchors, and quantifiers are supported, but unsupported or malformed syntax will be rejected.
Common causes of invalid regex include:
- Missing a closing parenthesis )
- Unclosed brackets [ ]
- Incorrect use of special characters like +, *, or ?
- Forgetting to escape special characters
- Copying regex from tools that use a different regex flavor
Note: If you are unfamiliar with Perl-style regex, review the supported syntax before building advanced rules.
To reduce errors:
- Build and test regex patterns incrementally
- Avoid unnecessary complexity
- Use external regex testers that support Perl-style syntax
- Test edge cases in the Simulator
Tip: Start with a simple rule and expand it only when needed.
If your goal is to:
- Match an exact word
- Check if text contains a value
- Validate numeric ranges
You may not need regex at all. Simpler rules are easier to maintain and less error-prone.
Common Issues
The rule shows “Invalid Regular Expression”
Cause: The regex contains a syntax error (for example, an unclosed bracket or missing parenthesis), unsupported syntax, or improper escaping.
Fix: Simplify the pattern, then rebuild it step-by-step. Check brackets [ ], parentheses ( ), and escaped characters, then test again in the Simulator.
The regex works in an online tester but fails in the platform
Cause: The tester may be using a different regex flavor or different escaping rules.
Fix: Use a tester that supports Perl-style regex, and verify that special characters are properly escaped in the rule editor.
Contacts are stuck at a Wait for Response step
Cause: The validation rule is invalid or too strict, so inputs never match.
Fix: Temporarily switch to a simpler rule (equals/contains) to confirm the flow logic works, then reintroduce a corrected regex and retest.
Valid answers are being rejected
Cause: The regex does not cover expected variations (spacing, punctuation, case, optional digits, etc.).
Fix: Identify real examples from test messages and update the pattern to include those variations, then test edge cases in the Simulator.
