The support forum

Exclude/include pattern specification

Hooch :

Dec 17, 2014

I would like to know exactly (100%) how pattern for includes/excludes works?

Is it exactly like in C#?

Nice thing would be to see live previews of patterns in that window where you select folders and files.

Alex Pankratov :

Dec 18, 2014

Perhaps it'd be the simplest to start with an example. Consider the following pattern:


It consists of 4 parts, split by the slashes (/) -


For this pattern to match a file, each part needs to match a part of the file path. By default, only relative path from the configured location to the file is used for comparison. That is, if the source location is


and the file is


then the app will only be matching


to the pattern.

The file path is split the same way as the pattern, at slashes. Then both sets of parts are compared *starting from the last part*. In the above case the first comparison will be between "file.e?e" and "file.ext".

If all parts *of the pattern* are matched, it's a match.

Since there might be more parts in the file path, this is referred to as a "tail match" pattern.


To require a complete match between the pattern and the relative file path, the pattern needs to start with ".\" (dot slash). For example,


will match


but not


because the "abc" in latter won't have a matching part in the pattern.

This is a "complete relative match" pattern. In a sense, the leading .\ simply anchors the pattern to the top of the configured location.


If a pattern starts with a slash alone, it will be compared to the absolute path of a file. For example,


will match


but won't match


This is a "complete absolute match" pattern. It anchors the pattern to the root of the drive (or network share) of the configured location.


And, finally, there's a "complete match" form which includes either a drive letter or the \\server\share -


These are, obviously, the most specific anchors.


Apart from the slash, there are two more special symbols - the asterisk (*) and the question mark (?). These are your standard wildcards that work exactly as you'd expect - the asterisk matches zero or more symbols and the question mark matches exactly one symbol.

Do note that since both the pattern and file path are split first and compared second, the wildcards cannot be used to match slashes as they are removed during the splitting step.


... and that's about it. Is there anything I missed?

Hooch :

Dec 18, 2014

Thanks that was good read.
I would propose to add this description with some examples to application help.

If you have time it would be awesome to see your patterns working in real time in window where you select files/folders to include (Under "Then include the following items). Something like small icon next to folder/file showing if it is included/excluded by filter.

Alex Pankratov :

Dec 22, 2014

Aye, noted.

This might not be an easy thing to implement *efficiently*, i.e. so that it won't lag on million-item trees, but let me see what I can do.

Hooch :

Jan 01, 2015

@Alex Pankratov.

My suggestion is to show it only on visible elements. It shouldn't lag that much or even at all than.

Alex Pankratov :

Jan 02, 2015

It won't work in all cases, e.g. if you start by excluding everything and then add "include *.exe" filter.

Hooch :

Feb 11, 2015

Hello. Small request. Can you add this topic to "FAQ / Features" Post before its gets lost? I think this is very helpful for new users.

Alex Pankratov :

Feb 12, 2015

Good idea. Done.

JohnO :

Jan 31, 2016

Might there possibly be a way around the "wildcards cannot be used to match slashes" in the future? It would be really great if it was possible to exclude e.g. all files with extension .xyz that are contained in directory abc/ and all subdirectories. Right now I have to do something like:

Alex Pankratov :

Feb 01, 2016

Noted. The way to do this would be to add support for **, which in (some) Unix shells does exactly what you are asking for. Can't give you the timeframe, but this will be done at some point.

mtc :

Feb 23, 2016

Any chance of changing this topic heading to "Full pattern specification" instead of "Full patter specification"?   It's a worthwhile thread, and it'll be easier to find with the right spelling.

Alex Pankratov :

Feb 24, 2016

Good idea, done.

aweber :

Feb 07, 2018

So I read this a few times.  It has good examples, but it never really lays-out the actual syntax rules.  It appears to be a very small subset of regexp, of course, but I'm not entirely sure.

Can we used more advanced regexp matching, or can you please post a list of all matching symbols in the latest versions?


Alex Pankratov :

Feb 07, 2018

Patterns are not regexps.

Patterns and paths are first split into parts at slashes and these parts are then matched using basic wildcard rules.

  *  matches 0 or more symbols
  ?  matches exactly one symbol

Patterns starting with \ and .\ have additional matching requirements (see top post for details).

That's it.

aweber :

Feb 07, 2018

So it's not easy to match directories named "log" and "logs", for example...which would be easy using regexp.

Alex Pankratov :

Feb 07, 2018

I feel your pain, but there are no current plans for adding regexp support.

rfgamaral :

Jun 28, 2018

Hey Alex,

You didn't found an efficent way to implement something like this as posted above by Hooch, did you?

I come from SyncBackPro and they had this feature that I found nice to have. I don't know if they have performance issues with large tress, but they only apply the visual difference (if filters were changed) by asking you if you want to apply the new exclude filters. Maybe you could take a look?

highend :

Jun 20, 2019

How do I exclude e.g. all .git folders, regardless of their depth and location?

E.g. src root:

.git folders:
D:\Development\Language 1\Project 1\.git
D:\Development\Language 2\Project 1\.git
D:\Scripts\Project 1\.git

In other words, they can be anywhere and at any level

Alex Pankratov :

Jun 20, 2019

Just Exclude + Folder + ".git"

New topic

Made by IO Bureau in Switzerland

Blog / RSS
Follow Twitter
Miscellanea Press kit
Company Imprint

Legal Terms