2

There are a lot of difference which I am not interested. For example, consider the following case:

LEFT : XXXXXXXX XXXXXXXXX RIGHT: XXXXXXXX XXXXXXXXX OPTIOINAL XYZ

I want to ignore this pattern of difference, but I just can make the filter work. Any suggestion?

3 Answers 3

5

I found this post because I was also struggling with WinMerge. The line filter documentation goes right at RegEx, so did I. Stupid me; none of the expressions I made did any filtering. Turns out you just put the string in common to left and right lines and it works like I want.

For example, I am comparing 2 XML files for certain differences. Some lines contain these strings:

IntID IntRef

They are preceded by whitespace, and open tag string and followed by a UUID, which is the entity that is causing a difference I would like to ignore.

So I just added two line filters with just the strings and no RegEx stuff. It was a bit slow to process a 12M file, but I more than made up for the time in having to ignore 1000+ hits to see the 4 differences.

I think this is what you are after with the XXXXXXXX XXXXXXXXX on the left and right. I am assuming the data is the same on each side.

1
  • I've been having good luck with WinMerge's line filtering, also. It took me a while to figure out the expression had to be common. Now I need to figure out how to match collapsed rows of text. It's source code and in many places 2 rows in the source are collapsed to one in the target and I want to ignore this. Any ideas on how to handle multiline issues like this? Feb 16, 2015 at 21:28
1

Great answer, KJM! I Would also suggest using the 2011 fork of WinMerge here. It has a nice testing feature in the line filter popup. For your particular case, your regular expression would look something like:

^(XXXXXXXX\sXXXXXXXXX).*$

or

^(XXXXXXXX\sXXXXXXXXX)(\sOPTIOINAL\sXYZ)*$

Check out here for regex examples.

2
  • Sadly the link stopped working, it seems.
    – Noah
    Oct 27, 2023 at 1:58
  • It looks like there's an update on that her: github.com/datadiode/winmerge2011 And it looks like the fork they mentioned is now the official version and it is active again and it does make a mention of some testing tools, so if youre in the market for it, I think that'd be worth checking out: github.com/WinMerge/winmerge Oct 30, 2023 at 14:42
0

I looked at file filters documentation for examples.

https://manual.winmerge.org/en/Filters.html

Example 2. File filter rule examples

Some simple file filter rules:

f: \.cpp$ ## Match *.cpp files
f: \.h$ ## Match *.h files
f: ^My ## Match My*.* files
f: Dlg\. ## Match *Dlg.* files
d: \\test$ ## Match test folders
d: ^\\Build$ ## Match Build folders
d: Temp$ ## Match *Temp folders (for example, FirstTemp)
d: Src ## Match *Src* folders

Some rules with more complex regular expressions:

f: ^\.#.*$ ## .#filename.version files
f: Dlg\.c(pp)?$ ## *Dlg.c and *Dlg.cpp files
f: ^I.*\.h$ ## I*.h files
f: Srv[1-9]\.def$ ## *Srv1.def to *Srv9.def files
f: ^[h,k,m] ## h*.*, k*.*, and m*.* files

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .