Wildcards - rejetto/hfs GitHub Wiki
Some settings support wildcards, like *.jpg
Special characters
*matches any number of characters, but not /. E.g.,*.jpg?matches a single character, but not /. E.g.,pic?.jpgmatchespic1.jpgandpic2.jpgbut notpic10.jpg**matches any number of characters, including /, as long as it's the only thing in a path part. E.g.,**.jpgwill match jpgs also in subfolders.!at the beginning of a pattern will negate the match. E.g.,!*.jpgwill match any file that is NOT jpg.|allows multiple values to be accepted (as an "or" expression). E.g.,*.jpg|*.pngwill match both jpg and png
Please refer to specific documentation for a more comprehensive guide.
Escaping
If you need some special character literally, like (, you can precede it with a \, like this: \(
Searching for files
When using the search button in the frontend, some extra rules apply:
- if your text includes
*, then the pattern is applied as it is- Eg: if you search
*.jpg, then .jpg must be at the end of the name - Eg: if you search
a*, you'll find all items starting with letterA(we are case-insensitive)
- Eg: if you search
- if your text doesn't include
*, then it can be anywhere- Eg: if you search
.jpg, .jpg is valid even if present in the middle of the name - this happens because
*is automatically added at the start and end of your text- if
|is used, then*is added at start+end of each part
- if
- Eg: if you search
Network masks
Network masks support 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. You cannot use wildcards if you use this other syntax.
localhost will automatically be translated to ::1|127.0.0.1.
Do NOT use square brackets when specifying an IPv6.
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 |.