Search code examples
regexfilterwinmerge

How to format a WinMerge fllter to ignore part of the line


I would like WinMerge to compare the full text but exclude a variable substring.

Orientation="West" PhysicalAddress="2395226" DefFieldFrmt="Uf4d0" UnitCustomText="sec"
Orientation="West" PhysicalAddress="2395230" DefFieldFrmt="Uf4d1" UnitCustomText="sec"

In the lines above I want to ignore the PhysicalAddress="xxx" and locate the changed DefFieldFrmt="Uf4d1"

I have tried adding the filter:

PhysicalAddress=".*"

However this filters the complete line.

The actual text before and after the PhysicalAddress="xxx" will vary so I need a filter that says: match prefix and match suffix but ignore target variable substring.

Help please.


Solution

  • According to the documentation, is not possible to use the line filters for this:

    When a rule matches any part of the line, the entire difference is ignored. Therefore, you cannot filter just part of a line.

    However, since WinMerge's source code is on GitHub, it is possible to add a feature request for this to its list of issues.