Jesse Black
Jesse Black

Reputation: 7976

Eclipse searching files in specific package

I am attempting to strip out my Log.i Log.d etc code in eclipse. I have used them liberally. I can find them by control+h and using the File Search tab. Once I can filter the results to a certain package I plan on doing a replace with a blank string.

I check the Regular Expression checkbox.
In the Containing text: field I use Log\..*;

This gets every single Log line of code in the workspace (At least I think workspace, because there is currently 1 project in the workspace)

How can I get this search to only search within a certain package (ie com.example.so.is.super.cool)

I assume this is in the File name patterns field and I have attempted:

.*super.*
*super*
super

Please let me know if there is a pattern I can enter in File name patterns that narrows the search down for me.

Upvotes: 5

Views: 2744

Answers (1)

Sri Sankaran
Sri Sankaran

Reputation: 8310

Here's how:

  1. Select the package in Package Explorer
  2. On the Search > File Search panel: Specify regular expression, set Scope to "Selected resources"
  3. Press Search

enter image description here

Upvotes: 7

Related Questions