Wednesday, March 29, 2017

Android Studio - Find in Path error

Leave a Comment

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?

4 Answers

Answers 1

You have 'regular expressions' checked, so you're looking for that pattern. See this. Uncheck that and see if it helps.

Answers 2

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

Answers 3

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[].

Answers 4

try...

String Params = params[90your int]

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment