[UserManual] Filter wildcards are greedy

Discuss new features and functions
huuurz
Posts: 16
Joined: 11 Mar 2018

Post by huuurz • 26 Nov 2019, 18:31

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
Last edited by huuurz on 27 Nov 2019, 13:25, edited 1 time in total.

User avatar
Plerry
Posts: 762
Joined: 22 Aug 2012

Post by Plerry • 27 Nov 2019, 09:09

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

huuurz
Posts: 16
Joined: 11 Mar 2018

Post by huuurz • 27 Nov 2019, 13:23

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.