Regular expression with not matched lines (V 4.0.1.2144)

Post your bug reports here.
Post Reply
calvini
Posts: 70
Joined: Thu Aug 16, 2007 10:09 am

Regular expression with not matched lines (V 4.0.1.2144)

Post by calvini »

I'm desperately trying to compare two files. All lines starting with a '#' should be ignored by comparing as they are meaningless in both files. As there are so many of them, it's nearly impossible to compare files "manually" if these lines show up as differences. I've tried any imaginable combination of options but it wont work. What am I doing wrong?

My simplest approach was setting R1 to "^#", leaving R2 empty, setting Files to "All Files" (compared files have extension "txt") and setting action to "Ignore String with match". Another one was setting R1 to "^[^#].*", leaving R2 empty and setting action to "Ignore lines not matching R1".

Neither worked. What can I do to exclude lines beginning with '#' from comparison?

While writing this, I came across another surely useful detail: The problem arises only, if there is no matching line in the other file, means "#foo" and "#bar" are considered equal by comparison, but if there ist a line "#foo" in one file and no corresponding line in the other file, the #foo-line shows up as a difference.

That is not what I expect when saying to ignore something, but maybe it's the intended behaviour of the program, leaving no option for me to get my comparison done?

brahman
Posts: 180
Joined: Thu Jan 11, 2007 6:18 pm

Post by brahman »

Got any C&H Comics? :)

Regards,

B.

grigsoft
Site Admin
Posts: 1673
Joined: Tue Sep 23, 2003 7:37 pm
Contact:

Post by grigsoft »

^#.* should do the trick, but I have not checked that myself. Even easier, ^# + "Ignore string with match" rule. Note that after this, all # lines are considered to be empty, so you need to add "ignore inserted empty lines" too.

calvini
Posts: 70
Joined: Thu Aug 16, 2007 10:09 am

Post by calvini »

grigsoft wrote:Even easier, ^# + "Ignore string with match" rule.
That was my first attempt ;).
grigsoft wrote:Note that after this, all # lines are considered to be empty, so you need to add "ignore inserted empty lines" too.
That's the point! Using that option it works fine in both cases. Thank you :D!

One little remark: At least the "Ignore lines not matching R1"-option should ignore the lines even if not matched in the other file. Otherwise it should be renamed in "Consider lines not matching R1 as empty". That would directly lead to using the "ignore inserted empty lines"-option.

Post Reply