Skip to content

Commit 6d82217

Browse files
[Ruleset Engine] Add regex limitations (#21164)
--------- Co-authored-by: Pedro Sousa <[email protected]>
1 parent d1ec0ec commit 6d82217

File tree

1 file changed

+11
-0
lines changed
  • src/content/docs/ruleset-engine/rules-language

1 file changed

+11
-0
lines changed

src/content/docs/ruleset-engine/rules-language/values.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,15 @@ Since the evaluation of string literal values in expressions is case-sensitive,
9999

100100
Cloudflare Business and Enterprise customer plans have access to the `matches` [comparison operator](/ruleset-engine/rules-language/operators/#comparison-operators) which supports regular expressions, so that you can capture multiple variants of a value with a single expression.
101101

102+
### Regular expression limits
103+
104+
Cloudflare has a few limits in place regarding regular expressions. One of those limits is that each rule supports a maximum of 64 regular expressions (regexes), regardless of your domain's plan.
105+
106+
You can use the following strategies to reduce the number of regular expressions in a rule:
107+
- Use the [`contains`](/ruleset-engine/rules-language/operators/#comparison-operators) operator.
108+
- Use the [`wildcard`](/ruleset-engine/rules-language/operators/#wildcard-matching) / [`strict wildcard`](/ruleset-engine/rules-language/operators/#wildcard-matching) operators.
109+
- Use the [`starts_with()`](/ruleset-engine/rules-language/functions/#starts_with) and [`ends_with()`](/ruleset-engine/rules-language/functions/#ends_with) functions.
110+
102111
## Boolean values
103112

104113
Simple expressions using boolean fields do not require operator notations or values. You only need to insert the field on its own, as shown in the `ssl` example below.
@@ -258,3 +267,5 @@ ip.src in {198.51.100.1 198.51.100.3..198.51.100.7 192.0.2.0/24 2001:0db8::/32}
258267

259268
tcp.dstport in {8000..8009 8080..8089}
260269
```
270+
271+

0 commit comments

Comments
 (0)