Viraj
Viraj

Reputation: 5381

Intellij Idea : Search in java Strings?

Is there a way to search only in java strings in Intellij IDEA ?

I have searched and could not found anything on this. I have to refactor hibernate HQL queries written as java strings. If IDE support search in strings it will be lot more easy to me.

Upvotes: 3

Views: 756

Answers (2)

Deutro
Deutro

Reputation: 3313

Pressing CTRL + SHIFT + F gives you the possibility to search in "String literals only":

CTRL + SHIFT + F

This also works with CTRL + F:

CTRL + F

Additionally you can enable regular expression for some fancy searches.

Upvotes: 9

npinti
npinti

Reputation: 52185

Unless I am misunderstanding you, you could build a regular expression to search inside quotation marks: "<whatever you need to search for>", something like so: "from eg.Cat". If you want it slightly more generic, you could do: "from .+?"

Upvotes: 1

Related Questions