User agent matches

Matches when the User-Agent request header matches one or more regular expressions.

This condition inspects the User-Agent header of the incoming request to determine if it matches a regular expression. It returns true if the header value satisfies any of the defined patterns.

Configuration

  • Case sensitive: Whether to enable case sensitivity during the comparison. When disabled, the condition performs a case-insensitive match against the User-Agent string.
  • Enter your pattern(s): The RE2 regular expression used to evaluate the User-Agent string. Entries should be separated by a new line.
  • Defined patterns: The list of all active patterns for this condition. The condition returns true if the User-Agent header matches any pattern in this list.

Measurement

The condition extracts the User-Agent header from the incoming request and evaluates it against the Defined patterns.

  • Match found: If the header value matches any regular expression in the list, the condition returns true.
  • No match found: If the header value matches none of the patterns, the condition returns false.
  • Missing header: If the User-Agent header is absent from the request, the condition returns false.

Performance

  • Sequential validation: Evaluation time increases incrementally with the number of patterns in the list. For requests that do not match any pattern, the system must evaluate every entry before returning false.
  • Short-circuit optimization: The condition iterates through the list and returns true as soon as the first match is identified. To minimize processing time, place the most frequently matched patterns at the top of the list.

Last modified March 5, 2026