Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I search files in Eclipse so the results shows files that do NOT contain the search term?

Tags:

search

eclipse

In Eclipse editor, if I go Search->File, I can search for files that contain my search term. What I want to do is find all of the files that DO NOT contain my search term. Is that possible?

like image 613
Cambo Avatar asked Jul 19 '09 01:07

Cambo


People also ask

How do I search across files in Eclipse?

The Eclipse search dialog box allows you to search for files that contain a literal or a character pattern in the entire workspace, a set of projects, a specific project or folders selects in the package explorer view. Clicking on the Search menu and selecting Search or File or Java. Clicking Ctrl + H.

How do I search for a phrase in Eclipse?

Press Ctrl + H , should bring up the search that will include options to search via project, directory, etc. Ctrl + Alt + G can be used to find selected text across a workspace in eclipse.

How do I search multiple keywords in Eclipse?

Use the built-in Eclipse Search dialog. The Search menu contains multiple items (Search→ Search, Search→ File, Search→ Help, and Search→ Java), but all of them open the same dialog.

How can I see all problems in Eclipse?

The Eclipse error log captures internal errors that are caused by the operating system or your code. To view the Eclipse error log: Switch to the Plug-in Development perspective. From the main menu, select Window > Show view > Other.


3 Answers

This expression should work (reference):

(?s)\A((?!YourSearchText).)*\Z 
like image 198
noup Avatar answered Sep 29 '22 16:09

noup


Try checking "regular expression" option and then input somethign like [^term] or (?!term) -- meaning of both of this is 'not term' but they are slightly different (please refer to some RegExp documentation like this).

like image 27
ymir Avatar answered Sep 29 '22 16:09

ymir


The simplest way imo is to use InstaSearch Eclipse plugin and type:

search text -wordToExclude -anotherWordToExclude

like image 37
Andrejs Avatar answered Sep 29 '22 14:09

Andrejs