Negative Text Search Engine

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.

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

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. 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. 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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s