Negative Text Search Engine

By Dimitris Kolovos

A little off-topic but hopefully useful. Recently, I needed to find all the .java files in my workspace that did not contain a particular phrase (“Eclipse Public License”) to find out which files I had forgot to add copyright notices to. I tried to do this with regular expressions but couldn’t seem to make it work. So I looked into the Eclipse search plugin and finally managed to scribble a negative text search engine i.e. an engine that returns all the files that do not contain a particular phrase. Instructions on how to install and use the plugin are available here.

4 Responses to “Negative Text Search Engine”

  1. Yury Kats Says:

    I think the regular file search with an regex like (Eclipse Public License){0} would do it.

  2. Dimitrios Kolovos Says:

    I’ve tried what you suggested but unfortunately it doesn’t seem to work. I’m sure there must be another way to do it – just couldn’t find it.

  3. Marek Says:

    I tried your feature but it does not show in my preferences->general->search configuration. According to Eclipse (3.3) the negative search feature is active. Any ideas ?

  4. Dimitrios Kolovos Says:

    I’ve acually built this against 3.4 but I believe it should work with 3.3 too. Do you have Java 1.6 installed? (the plugin is built against 1.6 but I should probably change it to 1.5 as there is nothing 1.6-specific about it).

Leave a Reply