Ashok ilanji
Ashok ilanji

Reputation: 21

How to search a string with pattern in all the files of a project in intelj?

We have used this option( Edit -> Find -> Find in Path) to search a string using IntelliJ. Currently, if we type to search a string, it will return the lines which contain the given string. But I want to find the lines which contain the given string and/or some pattern. Is there such a facility available in IntelliJ Idea?

Assume, We are going to search a string from the below lines

Test123456

Test12345

Sampletest12356

Search String: test*6

Expected output: Test123456

Search String: *test*6

Expected output: Test123456 , Sampletest12356

Upvotes: 2

Views: 292

Answers (1)

Mikhail Antonov
Mikhail Antonov

Reputation: 1367

You should turn on the "Regex" checkbox and type in a proper regular expression in the search field, that's all. If I understood correctly, for your examples the correct requests would be test.*6 and .*test.*6 respectively.

enter image description here

Upvotes: 3

Related Questions