5

I would like to ignore difference in lines, if one of the files has a line ending with //ignore is this possible? how would the regular expression for the line filter be written?

tried .*//ignore$ but this does not work

rekna
  • 5,313
  • 7
  • 45
  • 54

2 Answers2

1

When you launch a file compare from the Select Files or Folders dialog, after choosing the Left and Right files, click Select next to the Filter field.

In the Filters dialog, click the Linefilters tab, create the following line filter (add)

^//ignore

Enable the line filters you want to use and run your comparison.

Have fun!

Sven
  • 26
  • 1
  • it works using this regex (ignore lines containing the word 'custom' ) .*^((?!custom).)*.* – rekna Jun 17 '13 at 20:57
  • This still doesn't seem to work for me, the .*^((?!custom).)*.* expression simply ignores all lines while the ^//ignore expression ignores none of them... – sydan Feb 18 '15 at 14:38
0

I found line filters to be very lacking. I developed regular expressions filter yesterday using Boost Regex library.

I feel it does the job.

https://sourceforge.net/projects/regexfilterforw/files/

Feel free to try.

user108570
  • 129
  • 1
  • 3
  • could you give an example ? eg. if have two files, one somewhere containing this line: validationRuleSet.AddPropertyRuleSet("TitelId","TitelId") and the other containing this line validationRuleSet.AddPropertyRuleSet("TitelId","Titel") // custom Winmerge marks this as a difference because 1) TitelId differs from Titel and of course also because // custom is appended in the second file. I would like to tell winmerge , to ignore this line as a difference because its marked with "// custom" – rekna Apr 16 '10 at 15:04
  • I think you should be able to do something like this in regexrules file. ^.*//custom$ This should tell winmerge to ignore any lines containing //custom I'm not sure about / character. Maybe it needs to be escaped as ^.*\/\/custom$ – user108570 Jul 18 '10 at 15:09