All Products
Search
Document Center

Edge Security Acceleration:Match operators

Last Updated:Feb 13, 2026

The match operators in a rule include comparison operators and logical operators. You can use more than 10 types of comparison operators and logical operators between rules to build a variety of rule expressions.

Comparison operators

Comparison operators are used to compare the input values in a request with the values configured in an expression.

eq

Indicates that the input value in a request is equal to the match value.

  • Operator name: equal to

  • Match value type: String

  • Example:

    (http.host eq "www.example.com")

ne

Indicates that the input value in a request is not equal to the match value.

  • Operator name: not equal to

  • Match value type: String

  • Example:

    (http.host ne "www.example.com")

contains

Indicates that the input value in a request contains a specific string.

  • Operator name: contains

  • Match value type: String

  • Example:

    (http.host contains "example.com")

not...contains

Indicates that the input value in a request does not contain a specific string.

  • Operator name: does not contain

  • Match value type: String

  • Example:

    (not http.host contains "example.com")

matches

Indicates that the input value in a request complies with a specific regular expression. Compatible with Perl Compatible Regular Expressions (PCRE).

Note

Only Premium and Enterprise plans support regular expressions.

  • Operator name: matches the specified regular expression

  • Match value type: String

  • Example:

    (http.host matches "(www|blog)\.example\.com")

not...matches

Indicates that the input value in a request does not comply with a specific regular expression. Compatible with PCRE.

Note

Only Premium and Enterprise plans support regular expressions.

  • Operator name: does not match the specified regular expression

  • Match value type: String

  • Example:

    (not http.host matches "(www|blog)\.example\.com")

in

Indicates that the input values in a request contain one or more preset match values. You can also use $ together to implement grouping.

  • Operator name: contains one of the following items

  • Match value type: Array

  • Example:

    (http.host in {"www.example-1.com" "www.example-2.com"})

    ( ip.src in $<LIST_NAME>)

not...in

Indicates that the input values in a request do not contain all preset match values. You can also use $ together to implement grouping.

  • Operator name: does not contain any of the following items

  • Match value type: Array

  • Example:

    (not http.host in {"www.example-1.com" "www.example-2.com"})

    (not ip.src in $<LIST_NAME>)

starts_with

Indicates that the start of the input value in a request matches the preset match value.

  • Operator name: starts with

  • Match value type: String

  • Example:

    (starts_with(http.host, "blog"))

not starts_with

Indicates that the start of the input value in a request does not match the preset match value.

  • Operator name: does not start with

  • Match value type: String

  • Example:

    (not starts_with(http.host, "blog"))

ends_with

Indicates that the end of the input value in a request matches the preset match value.

  • Operator name: ends with

  • Match value type: String

  • Example:

    (ends_with(http.host, "cn"))

not ends_with

Indicates that the end of the input value in a request does not match the preset match value.

  • Operator name: does not end with

  • Match value type: String

  • Example:

    (not ends_with(http.host, "cn"))

le

Indicates that the input value in a request is less than or equal to the preset match value.

  • Operator name: less than or equal to

  • Match value type: int

  • Example:

    (ip.geoip.asnum le 45104)

ge

Indicates that the input value in a request is greater than or equal to the preset match value.

  • Operator name: greater than or equal to

  • Match value type: int

  • Example:

    (ip.geoip.asnum ge 45104)

lt

Indicates that the input value in a request is less than the preset match value.

  • Operator name: less than

  • Match value type: int

  • Example:

    (ip.geoip.asnum lt 45104)

gt

Indicates that the input value in a request is greater than the preset match value.

  • Operator name: greater than

  • Match value type: int

  • Example:

    (ip.geoip.asnum gt 45104)

len eq

Indicates that the length of the input value in a request is equal to the preset match value.

  • Operator name: length equal to

  • Match value type: String

  • Example:

    (len(http.request.cookies["session"]) eq 330688)

len gt

Indicates that the length of the input value in a request is greater than the preset match value.

  • Operator name: length greater than

  • Match value type: String

  • Example:

    (len(http.request.cookies["session"]) gt 330688)

len lt

Indicates that the length of the input value in a request is less than the preset match value.

  • Operator name: length less than

  • Match value type: String

  • Example:

    (len(http.request.cookies["session"]) lt 330688)

exists

Checks that a preset value exists in a request.

  • Operator name: exists

  • Match value type: String

  • Example:

    (exists(http.request.headers["user-agent"]))

not exists

Checks that a preset value does not exist in a request.

  • Operator name: does not exist

  • Match value type: String

  • Example:

    (not exists(http.request.headers["user-agent"]))

Other operators

lower

Converts letters of the input value in a request to lowercase letters if the request value is case-insensitive.

  • Operator name: case-insensitive

  • Match value type: String

  • Example:

    (lower(http.request.uri))

Logical operators

Logical operators are used to combine multiple expressions into a compound expression.

not

Executes the logical NOT operator on an expression.

  • Operator name: logical NOT

  • Example:

    not (http.host )

and

Indicates that the request must satisfy two or more expressions.

  • Operator name: logical AND

  • Example:

    (http.host eq "www.example.com" and ip.geoip.country eq "CN")

or

Indicates that the request only needs to satisfy one of the preset expressions.

  • Operator name: logical OR

  • Example:

    (http.host eq "www.example.com") or (ip.geoip.country eq "CN")