You are here

Rules and regexp driving me crazy

6 posts / 0 new
Last post
CarlosCastaneda
Offline
Last seen: 1 year 9 months ago
Joined: 2008-08-18 16:04
Rules and regexp driving me crazy

Could you please give a detailed description of valid characters and expressions of a regexp and how they are interpreted/applied.

Some example that behave very strange:
Files to exclude: "*"
Folders to exclude: "*"
Loactions to always include: "*b"

Using this rule matches file with "b" within the filename, even in subfolders although these are being excluded. Considering this a regexp I'd expect that only files named "b" should be considered.

Another example:
Folders to exlude: "*"

When I run this rule then all files are exclude but the only folder has been created.

PS: I'm using Toucan 2.1.0

Steve Lamerton
Steve Lamerton's picture
Offline
Last seen: 9 years 4 months ago
Developer
Joined: 2005-12-10 15:22
The

complete guide to the regex that Toucan uses is available here. The app here should be able to help you too, although I dont you it myself, I think you will probably have to tell it to use wxRegEx. As a quick attempt at solving your problem, in the first case I think it is because Locations to always include matches both files and folders. For your third question I am not sure I understand what you are saying happens.

CarlosCastaneda
Offline
Last seen: 1 year 9 months ago
Joined: 2008-08-18 16:04
Rules and regexp driving me crazy

Hi Steve,

thanks for your reply. The links are very helpful to know the correct syntax of how to build regluar expressions here. Nevertheless I don't get my expample to work. I want to sync/update some files only. For that reason I exclude all files as well as all directories and include those files based on their file name. But it still doesn't work. I think the regexp should be o.k.

The source dir is as follows
.\abc\
.\abc\a.txt
a.txt
b.txt
bc.txt
c.txt

Destination Directory contains
a.txt
b.txt
c.txt

The rule is
FilesToInclude=|*^[^\\]+\\.txt$
FilesToExclude=|*.*
FoldersToExclude=|*.*

File a.txt in the source folder has been modified.
Running the sync I'd expect all modified/missing files to be copied (a.txt and bc.txt) but actually the folder abc has been created and no file was copied.

The Progress window even doesn't mention the creation of abc.

14:45:40 Starting

Setting up progress bar

00:00:01 Elapsed
14:45:41 Finished

Moreover Preview does not higlight which files will be under consideration (e.g. I'd expect that a.txt and bc.txt should change the color).

CC

Steve Lamerton
Steve Lamerton's picture
Offline
Last seen: 9 years 4 months ago
Developer
Joined: 2005-12-10 15:22
Sorry

for the delay in replying, I guess I don't quite understand what you want your regex to copy, if you only want certain filenames to be included then it seem to me that regex's are too complex, just simply putting in abc\a.txt should include only that file, using just the standard plain text matching.

EDIT: As for the previewing hopefully the pre-release should sort it out

CarlosCastaneda
Offline
Last seen: 1 year 9 months ago
Joined: 2008-08-18 16:04
Hi Steve, the example doesn't

Hi Steve,

the example doesn't seem very useful, but it's only for simplicity. What I really want to do is to synchronize some files from the CygWin enviroment, which means all files starting with dot (e.g. .bashrc, .bash_profile, .xinitc, etc....) but only on the top level directory. For that reason I have to exclude all files (there may be some regular files which I don't want to be taken into consideration) as well all descending directories (there might be also some directory name starting with dot, e.g. .ssh, .svn, etc....). No single directory in the top level source directory should be created in the target directory (that's what actually happens).

I hope that clarifies my intention for using regexp.

When I do some
CC

Steve Lamerton
Steve Lamerton's picture
Offline
Last seen: 9 years 4 months ago
Developer
Joined: 2005-12-10 15:22
Ahhh,

I see! I am afraid I am really busy at the moment, I am in the middle of exam season unfortunately, so sorry for taking so long to reply!

This is actually a surprisingly annoying problem! I have just been puzzling over it and I am really not sure the best way to do this, I shall try a few things out in the next couple of days, I think that Toucan should be able to handle this much better. I hope to provide some more info soon, sorry again for the delay.

Log in or register to post comments