[UserManual] Filter wildcards are greedy

Discuss new features and functions
Posts: 28
Joined: 11 Mar 2018

huuurz

Hi,

I think it is worth mentioning somewhere that the wildcard asterisk acts greedy here, which means it will match as much as possible.

Therefore, exclusion filter
\SubFolder\*.tmp
will exclude all .tmp files (and folders) in SubFolder, no matter how deep in the hierarchy (e.g. \SubFolder\AnotherSub\data\new\cache.tmp).

A non-greedy asterisk would not match any (back)slashes, which means you can filter for direct descendants of \SubFolder\. This is currently not possible, right?

Greets,
Huuurz
User avatar
Posts: 2451
Joined: 22 Aug 2012

Plerry

You are correct!
In that sense the asterisk wildcard is as greedy as e.g. in the Windows command prompt (Cmd) or the Search function in file Explorer. And (in my view) for clear reasons; see e.g. here.

If it is important to have .tmp-files in subfolders of Subfolder included in your sync, you can define a second left-right pair one level deeper (at Subfolder level). Assume you have a present absolute path [Left1] and [Right1] to the left, respectively right-root folder of your sync.
The second left-right pair would then be [Left1]\Subfolder and [Right1]\Subfolder.
For this second left-right pair you can define a local Include filter
\*\*.tmp
If Subfolder may contain a direct subfolder again named "Subfolder" (are you still there ...) you need to make your initial Exclude filter entry local to the first, initial left-right folder pair (otherwise your global Exclude filter would exclude any .tmp-files in the tree Subfolder\Subfolder)

Nevertheless, as I stated earlier in this forum, I would love to see RegEx support in Include/Exclude filter settings.
However, I know this is a lot to ask ...
Posts: 28
Joined: 11 Mar 2018

huuurz

Ah yes, the other guy had the same problem (didn't find that post earlier).
Thank you for the workaround!

Yeah changing current behaviour imho doesn't make sense. It's sufficient for most cases. Adding some RegEx support would be a very welcome powerful tool, but may be slowing down comparison times a lot.