u123
u123

Reputation: 16287

Eclipse search for perfect match (regex)?

In eclipse its possible to do a file search Ctrl+H. I need to do this but it must only return a perfect match like 'com.company.base' and not all strings that have this as a prefix, eg.

com.company.base.model com.company.base.db com.company.base.ui etc.

I have tried to enable the regex option but am not sure how to formulate that it should be a perfect match. Any ideas?

Upvotes: 1

Views: 153

Answers (2)

Petar Ivanov
Petar Ivanov

Reputation: 93030

Try that:

\scom\.company\.base\s

You need to escape the . - otherwise it means any character. \s means white space.

Upvotes: 1

Bohemian
Bohemian

Reputation: 425043

What about searching for com.company.base where the next character is not a dot?

com.company.base[^.]

Upvotes: 0

Related Questions