Better projectwide search queries

A welcome feature, to help diagnose issues with legacy code, is an option in the Find Files tool to search for multiple strings.

For instance, I want to find the document in my project that contains "URL", "API", & "https"

2 comments
Comment actions Permalink

Hi there,

Well, you can do multiple searches one-by-one.

1. Do a search for the 1st keyword (e.g. "URL"). Make sure "Open in Find Window" button in the bottom right was used to list ALL results (and not just TOP 100 matches that Find in Files popup shows).

2. Invoke a new Find in Files search -- search for another keyword (e.g. " API") and make sure to select "Files in previous search result" Scope.

3. Repeat the same step #2 for the 3rd keyword.

 

In case if ALL needed keywords are appearing in the same order (e.g. "API" will always appear after "URL") then you can also use RegEx option, e.g. for the 2 keywords (will find them even if they are on different lines):

URL(?:.|\n)*API

Sure, you can build a RegEx that will match them in any order, but it's a bit harder to do and read/edit it.

0
Comment actions Permalink

Great!

Thank you for the detailed answer

0

Please sign in to leave a comment.