Pier-Alexandre Bouchard
Pier-Alexandre Bouchard

Reputation: 5245

eclipse file name pattern search with regular expression

I have a lot of java files:

Foo01.java
Foo02.java
Foo03.java
Foo04.java
Foo05.java
Foo01Bar.java
Foo01Bar.java
Foo02Bar.java
Foo03Bar.java
Foo04Bar.java
Foo05Bar.java

And I need to replace an expression in and only in FooXX.java classes.

Using CTRL + H in eclipse, in the file name pattern, I tried Foo(\d\d).java, but It does not work. If I write Foo*.java, every FooXXBar.java will also appears, and I don't want to.

What's the way to do it?

Upvotes: 1

Views: 1958

Answers (1)

Leon
Leon

Reputation: 538

I don't think eclipse has the capability to do full regular expressions on file names. As far as I know you can use * to match any string and ? to match any single character for a file. As a result if your file list is similar to the above you can search for:

Foo??.java

For more complex file searches you probably need to use a combination of the unix/windows command line tools (depending on your OS choice).

Upvotes: 3

Related Questions