Regex conditions let a custom rule match patterns instead of fixed text. They are useful when the request you want to catch varies, for example a numeric ID or a family of file extensions. Each expression is an additional condition, and all of them must match for the rule to fire.
Pro requirement
Regex conditions are evaluated only on Pro installations. On a Free installation, a rule that contains regex conditions is skipped by the engine rather than run without them, so it never behaves more broadly than you wrote it. Upgrade to Pro, or rewrite the rule using Contains all tokens, if you need it on a Free site.
How to write them
- Enter one regular expression per line in the rule’s Regex field.
- Include delimiters, for example
/order_id=d{6,}/i. - Keep expressions bounded and specific. Broad patterns such as
/.*/make a rule noisy. - Invalid expressions are detected; a rule with an invalid regex does not match, and the problem is recorded in the logs.
Example
Match API calls that send an unusually long ids parameter:
/ids=[0-9,]{500,}/Test before enforcing
Use WAF Settings → Test & Recovery → Policy Test to evaluate a sample path and payload against the current policy without sending a request. Start the rule with the Log action and review Logs / Attack Story before blocking.
Related: Path pattern matching, Aegisify WAF Free vs Pro.
