GithubHelp home page GithubHelp logo

alex-ilin / regexprefilter Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 360 KB

Prediffer plugin for WinMerge that uses regular expressions to selectively hide changes.

PHP 0.88% C 9.92% C++ 76.99% HTML 12.21%

regexprefilter's Introduction

Regular Expression PreFilter for WinMerge v2.14

I found this WinMerge plugin on SourceForge, and decided to improve it a little. I'm giving the result back to the community so that maybe someone picks it up and takes it further someday. Alexander Ilin, 2015.

regexPreFilter

The plugin is used to apply regular expression filtering on per-line basis. Start your file comparison as usual, then select the regexPreFilter.dll in the Plugins menu. The parts of the file that match one of the regular expressions will be considered unmodified by WinMerge.

Example

Let's say you have two files with grocery lists:

It looks like almost entire file was rewritten, but in fact only one line was added, and the rest of the lines below it only had their numbers updated. We'd like to ignore the difference in line numbers and focus on the content changes, so we put the following regular expression in the regexPreFilter.regex file:

^[0-9]+ 

Next, we select the plugin in the main menu:

Now all we see are the important changes:

Installation

  1. Download the zip-file, it contains the plugin and an example regex-file.
  2. Copy regexPreFilter.dll and regexPreFilter.regex to your WinMerge plugins folder (normally it's C:\Program Files\ WinMerge\ MergePlugins).
  3. Enable the plugins. Go to the WinMerge's Plugins menu, choose List, check Enable plugins and click OK.

Use

Each line of the regex-file contains a separate rule.

You can modify the rules on the fly, the regex-file is reread every time comparison is redone (press F5 to recompare the currently open files in WinMerge).

You can create multiple copies of the plugin DLL with different names. Each copy will load the corresponding regex-file. This way you can have multiple rulesets selectable in the Prediffer menu.

You'll have to manually activate the plugin every time you compare files. It is off by default, and there is no way to enable it automatically (as of WinMerge v2.14). This is probably a good thing: you would not want to miss some changes without explicitly making them disappear.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.