Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple eclipse search problem

Tags:

search

eclipse

I use the eclipse File Search option very much to search all files in my workspace for a certain content. But how do I specify that it should only return hits from a fixed search criteria? As an example I would like to find all occurrences of the string:

com.mystuff.data

but I also get all the hits for:

com.mystuff.data.ui

How do I make a "this-string-only-search" when searching files in my workspace??

like image 738
u123 Avatar asked Feb 11 '11 04:02

u123


2 Answers

If I understand you correctly, Eclipse don't provide option to search exact word. You can use regular expression for it.
You can use \bSearchKeyword\b to find exact word.

like image 178
Ajinkya Avatar answered Oct 29 '22 03:10

Ajinkya


I suggest that you use regular expressions.

Here are the steps:

  1. Select the checkbox "Regular expression" which is located beside the "Containing text" field.
  2. In the "Containing text" field write: com.mystuff.data\D\W

Note that:

  • \D means "no digit"
  • \W means "no alphanumeric"
  • In case you would like to refine the regular expression, click Ctrl-SPACE, in order to get the regular expression assistance.

Hope this helps.

Best regards

like image 31
Samar Hossam Avatar answered Oct 29 '22 03:10

Samar Hossam