# User-Agents

This setting allows you to specify your custom Perl-compatible regular expressions (PCRE) lists for filtering visitors based on their user agent string. Comparison is case-sensitive. By default, the search for matches is done anywhere in the user agent string; you can use the ^ and $ anchors to match the pattern to the beginning or end of the string (see examples below).

The PCRE syntax is very rich and powerful and goes beyond the scope of this documentation. Individual expressions can be combined using various syntactical constructs, allowing you to create complex patterns.

Here are a few examples:

Firefox|Nexus|Miui

This expression matches any user agent that contains the words "Firefox," "Nexus," or "Miui." It can be used to filter visitors using Mozilla Firefox, Google Nexus, or Xiaomi's built-in browser.

^Mozilla/4[.]0

This expression matches any user agent that starts with "Mozilla/4.0." It filters out suspicious visitors who claim to use very old browsers but still support modern JavaScript constructs (assuming the visitor could create a machine fingerprint).

^Mozilla/5[.]0$

This expression filters visitors whose user agent strictly matches "Mozilla/5.0," meaning it doesn't contain information about a specific browser, HTML engine, or platform, which is unusual and suspicious.

All the expressions above can be combined using the logical "or" (i.e., it matches the first one or the second one or the third one) as follows:

Firefox|Nexus|Miui|^Mozilla/4[.]0|^Mozilla/5[.]0$

Note! Improperly formed regular expressions can lead to false positives and filtering out large amounts of legitimate traffic. Use this setting only if you know what you're doing.