Regular Expression Examples

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 $.

IPRegular ExpressionResult in whitelistRemark
name@server.dename@server\.deacceptedNo unique match
my-name@server.demoname@server\.deacceptedNo unique match
myname@server.demoname@server\.de$blockedNo unique match Match
myname@server.demo^name@server\.deblockedNo unique match
myname@server.demo^name@server\.de$blockedUnique match

Example of email ranges

Pay attention to the specification of the alternatives (a|b|c): a or b or c are allowed here.

IPRegular ExpressionResult in whitelistRemark
name@server.de^name@server\.(de|test)$acceptedUnique match
name@server.test^name@server\.(de|test)$acceptedUnique match
name@server.com^name@server\.(de|test)$blockedUnique Match

IP whitelist examples

Single email example

Note the inclusion of string start symbol ^ and string end symbol $.

IPRegular ExpressionWhitelist resultRemark
127.0.0.1127\.0\.0\.1acceptedNo unique match
127.0.0.12127\.0\.0\.1acceptedNo unique match Match
127.0.0.12127\.0\.0\.1$blockedUnique match
127.0.0.1227\.0\.0\.12$acceptedUnique match
127.0.0.12^27\.0\.0\.12$blockedNot a unique Match
127.0.0.12^27\.0\.0\.12$acceptedUnique match

Example email ranges

Pay attention to the repetition setting {n,m}: Repeat at least n times, but no more than m times.

IPRegular ExpressionWhitelist resultRemark
127.0.0.1^127\.0\.0\.1\d{0,2}$acceptedUnique match
127.0.0.12^127\.0\.0\.1\d{0,2}$acceptedUnique Match
127.0.0.123^127\.0\.0\.1\d{0,2}$acceptedUnique match
127.0.0.2^127\.0\.0\.1\d{0,2}$blockedUnique match