Pattern
Overview / Spec / Enhance / Pattern
Description#
If some files should be or not be synchronized to (or from) other devices, configure the corresponding SyncFilePattern/IgnoreFilePattern. All patterns are relative to the folder root (The folder you select while get into DevMode).
Caution
The priority of the IgnoreFilePattern is higher than SyncFilePattern, so if your pattern both covered the same file, the file will be ignored.
Patterns syntax#
Regular file names match themselves, i.e. the pattern
foomatches the filesfoo,subdir/fooas well as any directory namedfoo. Spaces are treated as regular characters, except for leading and trailing spaces, which are automatically trimmed.Asterisk (
*) matches zero or more characters in a filename, but does not match the directory separator.te*nematchestelephone,subdir/telephonebut nottele/phone.Double asterisk (
**) matches as above, but also directory separators.te**nematchestelephone,subdir/telephoneandtele/sub/dir/phone.Question mark (
?) matches a single character that is not the directory separator.te??stmatchestebestbut notteb/stortest.Square brackets (
[]) denote a character range:[a-z]matches any lower case character.Curly brackets (
{}) denote a set of comma separated alternatives:{banana,pineapple}matches eitherbananaorpineapple.Backslash (
\) “escapes” a special character so that it loses its special meaning. For example,\{banana\}matches{banana}exactly and does not denote a set of alternatives as above. Escaped characters are not supported on Windows.A pattern beginning with
/or./matches in the root of the folder only./fooor./foomatchesfoobut notsubdir/foo.A pattern beginning with a
(?i)prefix enables case-insensitive pattern matching.(?i)testmatchestest,TESTandtEsT. The(?i)prefix can be combined with other patterns, for example the pattern(?i)picture*.pngindicates thatPicture1.PNGshould be synchronized. On Mac OS and Windows, patterns are always case-insensitive.
Note
Prefixes can be specified in any order (e.g. “(?i){foo,bar}/*/bar”), but cannot be in a single pair of parentheses (not "{foo,(?i),bar}/*/bar").
Example#
Given a directory layout:
and with following config:
The priority of the IgnoreFilePattern is higher than SyncFilePattern and the end result becomes: