How to ignore files that start with a ~?


Recommended Posts

I don't believe at present you can do "beginning with" matches in .SyncIgnore - it would be great if you could do full REGEX matches in .SyncIgnore, but at present, only the "?" and "*" wildcards are available (in REGEX syntax, matching files that start with a "~" would simply be "^~" (no quotes))

Link to comment
Share on other sites

I didn't receive an answer so I tried "~*" (without the surrounding quotes) in all .SyncIgnore files. Seems to work.

Didn't you want to specifically exclude files that STARTED with a "~"?

"~*" would theoretically only filter files CONTAINING a "~", (rather than only filtering just those files actually starting with a "~") i.e. it would match both the following examples:

~somefile.dat

some~file.dat

Link to comment
Share on other sites

Ignore lists generally work this way - including BTSync :

If there is a path separator ('/' or '\') in the line, it's matched against the relative path of the file.

Otherwise one line means only a filename.

So:

somefile.dat matches somefile.dat in every directory

~* matches ~somefile.dat

*$ matches somefile.dat$

dir/~* matches dir/~somefile.dat and asd/dir/~somefile.dat but not other/~somefile.dat

and the same strictly to the current root: /dir/~*

Link to comment
Share on other sites

I don't believe at present you can do "beginning with" matches in .SyncIgnore - it would be great if you could do full REGEX matches in .SyncIgnore, but at present, only the "?" and "*" wildcards are available (in REGEX syntax, matching files that start with a "~" would simply be "^~" (no quotes))

Hm, please have a look at the default entries in .SyncIgnore. What does "._*" (without quotes) mean then? Especially the * at the end would be quit confusing then. "._" would be enough then.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.