Pattern
Overview / Spec / Enhance / Pattern
#
DescriptionIf 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 syntaxRegular file names match themselves, i.e. the pattern
foo
matches the filesfoo
,subdir/foo
as 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*ne
matchestelephone
,subdir/telephone
but nottele/phone
.Double asterisk (
**
) matches as above, but also directory separators.te**ne
matchestelephone
,subdir/telephone
andtele/sub/dir/phone
.Question mark (
?
) matches a single character that is not the directory separator.te??st
matchestebest
but notteb/st
ortest
.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 eitherbanana
orpineapple
.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./foo
or./foo
matchesfoo
but notsubdir/foo
.A pattern beginning with a
(?i)
prefix enables case-insensitive pattern matching.(?i)test
matchestest
,TEST
andtEsT
. The(?i)
prefix can be combined with other patterns, for example the pattern(?i)picture*.png
indicates thatPicture1.PNG
should 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").
#
ExampleGiven a directory layout:
and with following config:
The priority of the IgnoreFilePattern
is higher than SyncFilePattern
and the end result becomes: