Wildcards - rejetto/hfs GitHub Wiki

Some settings support wildcards, like *.jpg

Special characters

  • * matches any number of characters, but not /. Eg: *.jpg
  • ? matches a single character, but not /. Eg: pic?.jpg matches pic1.jpg and pic2.jpg but not pic10.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

Please refer to specific documentation for a more comprehensive guide.

Network masks

Network masks supports the syntax above, therefore you can use wildcards like this 192.168.0.*. If you want to exclude 192.168.0.5 from this, you can use this syntax 192.168.0.!(5).

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