user316117
user316117

Reputation: 8281

Android Studio - Find in Path error

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

Answers (5)

vmg
vmg

Reputation: 4326

You have 'regular expressions' checked, so you're looking for that pattern.

See

this.

Uncheck that and see if it helps.

Upvotes: 7

CodeToLife
CodeToLife

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

Alhaadi Dev
Alhaadi Dev

Reputation: 19

try...

String Params = params[90your int]

Upvotes: -2

Abdullah Raza
Abdullah Raza

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

Amir daraei
Amir daraei

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

Related Questions