-
-
Notifications
You must be signed in to change notification settings - Fork 228
Wildcards
Massimo Melina edited this page Nov 2, 2023
·
7 revisions
Some settings support wildcards, like *.jpg
-
*
matches any number of characters, but not /. Eg:*.jpg
-
?
matches a single character, but not /. Eg:pic?.jpg
matchespic1.jpg
andpic2.jpg
but notpic10.jpg
-
**
matches any number of characters, including /, as long as it's the only thing in a path part. Eg:**.jpg
will match jpg-s also in subfolders. -
!
at the beginning of a pattern will negate the match. Eg:!*.jpg
will match any file that is NOT jpg. -
|
allow multiple values to be accepted (as an "or" expression). Eg:*.jpg|*.png
will match both jpg and png
Network masks supports the syntax above, therefore you can use wildcards like this 192.168.0.*
.
Alternatively you can use a network syntax, supporting CIDR and ranges. The previous example is the same as doing 192.168.0.1/24
, or also 192.168.0.1-192.168.0.255
.
CIDR syntax and operators !
and |
available from version 0.45, ip-ranges from version 0.48.
Tip: thanks to the negation operator !
you can turn the blacklist into a whitelist. Example: by blacklisting !192.168.*|10.*|127.0.0.1|::1
you are actually whitelisting local addresses. If you have multiple addresses to whitelist, have them all on a single line, joined by |
.