Как использовать линейный фильтр winmerge?

5937
lamwaiman1988

Есть много различий, которые меня не интересуют. Например, рассмотрим следующий случай:

ВЛЕВО: XXXXXXXX XXXXXXXXX ПРАВО: XXXXXXXX XXXXXXXXX OPTIOINAL XYZ

Я хочу игнорировать эту схему различий, но я просто могу заставить фильтр работать. Любое предложение?

2

2 ответа на вопрос

5
KJM

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.

Мне также повезло с фильтрацией строк WinMerge. Мне понадобилось некоторое время, чтобы понять, что выражение должно быть общим. Теперь мне нужно выяснить, как сопоставить свернутые строки текста. Это исходный код, и во многих местах 2 строки в исходном тексте свернуты в одну в целевом, и я хочу игнорировать это. Любые идеи о том, как справиться с многострочными вопросами, как это? Dan Csharpster 9 лет назад 0
1
Dan Csharpster

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.