0

I am looking for a way to setup WinMerge to allow me to compare two text files. BUt to make my comparison easier, I would appreciate if this software could ignore the some lines, in function of how they are starting.

I tried to use the LinesFilter option, but I am little bit confused of about how to use this option.

Could you please help me ?

Thanks in advance

1 Answers1

0

According to the official document:

A line filter is a rule that is evaluated against each single-line difference in your compared files, if line filter rules are enabled. When a rule matches a single-line difference, the difference is ignored.

Your question is quite similar to the first example idea on the document. If you want to ignore the lines starting with > Test, you can use the following simple RegExp syntax:

^> Test

It will ignore the entire change in the line starting with > Test:

enter image description here

In case you want to ignore the spaces ahead > Test, just change the RegExp syntax to:

^\s*> Test

include space

Explain the RegExp syntax above (by regex101):

  • ^ asserts position at start of a line
  • \s matches any whitespace character (equivalent to [\r\n\t\f\v ])
  • * matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
  • > Test matches the characters > Test literally (case sensitive)