Regular Expressions
If you activate the Regular Expressions option, all email lists and IP lists are understood as comma-separated lists with regular expressions.
All additional spaces that are directly around the commas are removed.
The email and IP check is aborted at the first match and access is granted (whitelist) or blocked (blacklist) accordingly.
If logging is activated, this first matching regular expression is entered in the logs in the Request field.
Note: If the regular expression itself contains a comma ^127\.0\.0\.1\d{0,2}$ then you must use at least one (1) semicolon as a separator. Even if it is the only expression in the list in the parameter.
Note: If there is at least one (1) semicolon in the list, then the semicolon is automatically used as a separator and the comma is freely available.
Examples of using commas in the regular expression:
- Example 1 (semicolon at the beginning):
; ^127.0.0.1\d{0,2}$ - Example 2 (semicolon at the end):
^127.0.0.1\d{0,2}$ ; - Example 3 (semicolon between expressions):
^127.0.0.1\d{0,2}$ ; ^167.0.0.1\d{0,2}$
Note:
The frequently used dot . is reserved in Regular Expression and stands for an 'arbitrary printable character'.
It should therefore be escaped with a backslash \ if the dot character is specifically meant in an email or IP.
We recommend the following website as an online tool for developing and testing regular expressions.
But there are also other good online tools:
RegExr: Learn, Build, & Test RegEx.
We recommend the following website as a compact online tutorial on regular expressions.
But there are also other good online tools:
The 30 Minute Regex Tutorial.
Email whitelist examples
Single email example
Note the inclusion of string start symbol ^ and string end symbol $.
IP | Regular Expression | Result in whitelist | Remark |
---|---|---|---|
name@server.de | name@server\.de | accepted | No unique match |
my-name@server.demo | name@server\.de | accepted | No unique match |
myname@server.demo | name@server\.de$ | blocked | No unique match Match |
myname@server.demo | ^name@server\.de | blocked | No unique match |
myname@server.demo | ^name@server\.de$ | blocked | Unique match |
Example of email ranges
Pay attention to the specification of the alternatives (a|b|c): a or b or c are allowed here.
IP | Regular Expression | Result in whitelist | Remark |
---|---|---|---|
name@server.de | ^name@server\.(de|test)$ | accepted | Unique match |
name@server.test | ^name@server\.(de|test)$ | accepted | Unique match |
name@server.com | ^name@server\.(de|test)$ | blocked | Unique Match |
IP whitelist examples
Single email example
Note the inclusion of string start symbol ^ and string end symbol $.
IP | Regular Expression | Whitelist result | Remark |
---|---|---|---|
127.0.0.1 | 127\.0\.0\.1 | accepted | No unique match |
127.0.0.12 | 127\.0\.0\.1 | accepted | No unique match Match |
127.0.0.12 | 127\.0\.0\.1$ | blocked | Unique match |
127.0.0.12 | 27\.0\.0\.12$ | accepted | Unique match |
127.0.0.12 | ^27\.0\.0\.12$ | blocked | Not a unique Match |
127.0.0.12 | ^27\.0\.0\.12$ | accepted | Unique match |
Example email ranges
Pay attention to the repetition setting {n,m}: Repeat at least n times, but no more than m times.
IP | Regular Expression | Whitelist result | Remark |
---|---|---|---|
127.0.0.1 | ^127\.0\.0\.1\d{0,2}$ | accepted | Unique match |
127.0.0.12 | ^127\.0\.0\.1\d{0,2}$ | accepted | Unique Match |
127.0.0.123 | ^127\.0\.0\.1\d{0,2}$ | accepted | Unique match |
127.0.0.2 | ^127\.0\.0\.1\d{0,2}$ | blocked | Unique match |