Reputation: 8281
In Android Studio 2.2.2 in Find in Path I was trying search for the string
String params[]
so I typed it into the "Text to find:" box and I got the error
Bad pattern "String params[]" unclosed character class
What does this mean and how do I search for my string?
Upvotes: 5
Views: 1607
Reputation: 4326
You have 'regular expressions' checked, so you're looking for that pattern.
See
.
Uncheck that and see if it helps.
Upvotes: 7
Reputation: 4171
In my case, once that 'find in path' stopped working. Then I found how to enable it again. You need to reformat the java code by rightclick on package node and the same with res node. There is an item within the list telling 'Reformat code'.
Upvotes: 0
Reputation: 600
Since this is the regular expression which you put in "text to find" . the [ and ] are itself used in regex so you have to escape these brackets or in other words tell the finder that it is part of string i want to search.. so
String params\[\] should work and you should get the usages of String params[].
Upvotes: 1
Reputation: 63
First the Android Studio nice for search whole project, As mentioned those question 'Find All' in Android Studio
and this
Search all the occurrences of a string in the entire project in Android Studio
if you have the problem with 'Find in Path', you could test another like:
On Windows:
Find : Ctrl + F
Find And Replace In Single Class: Ctrl + R
on Mac:
Find : Command+ F
Find And Replace In Single Class: Command+ R
Upvotes: 1