Regular Expression problem

Post your bug reports here.
Post Reply
jmckeown
Posts: 9
Joined: Thu May 31, 2007 1:16 pm

Regular Expression problem

Post by jmckeown »

I use the regular expression:

%%CreationDate:\s+\w{3}\s+\w{3}\s+\d{1,2} \d{1,2}:\d{1,2}:\d{1,2}\s+\d{4}

and I have it set to ignore strings with match. However, this string gets through every time:

This is what my file looks like:
==================================
%!PS-Adobe-3.0
%%Title: Something here
%%Creator: Some Company
%%CreationDate: Thu May 24 08:42:15 2007
==================================

The creation date always ends up in the report. Am I missing something here? I have all of the "Ignore blanks" unchecked. The only thing checked in the entire comparison section of options is "Use Regular Expressions" and "Find moved sections". Min string length to match is set to 0. In the Line comparison sec tion, use line compare is checked. Min chars to match is set to 3. Min % of line to match is set to 30 and use adaptive comparison is checked.

Thank you for your responses!

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

Post by grigsoft »

Do you really need to filter line using full string content? Without studying what is wrong with RegExp (or engine :) ), I could suggest you using plain ^%%CreationDate: rule with same action to filter it out.

jmckeown
Posts: 9
Joined: Thu May 31, 2007 1:16 pm

Post by jmckeown »

That is what I have been doing for some of them, however this expression does not always appear on the beginning of the line in all of my files, and sometimes I need information that is on the right side of it. I'll see if I can locate an example of these.

I appreciate your very fast replies, I figured I wouldn't see a response for a number of days when I posted this.

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

Post by grigsoft »

I have played with your RegExp and it works just fine in my case. Maybe I have missed it - how do you see it is not working?

jmckeown
Posts: 9
Joined: Thu May 31, 2007 1:16 pm

After testing

Post by jmckeown »

After some testing, I figured out what is wrong. I would consider it a bug, or at least a miswording. When you go into the regular expressions section of your options, then set up a regular expression, you get to choose the file types that you wish for the regular expression to work on. If you choose "All files", then edit the name of the two files you are comparing by remove the extensions you will find that regex will not parse on those files. You must specify a specify a special listing and fill it with "* *.*" to get it to work properly on files without extensions.

You can test this by changing the date in the listing i gave you earlier in one file, then naming the file "test" and the other one "test.txt" and it will say that the date is different.

Thanks!

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

Post by grigsoft »

Hm, seems like you are right and standard *.* mask does not cover files without extensions in Compare It. This is definitely a bug, I will fix it soon.

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

Post by grigsoft »

I have uploaded a fix in latest beta: http://www.grigsoft.com/wincmp4b.zip

Post Reply