Restrict parts of a search to directory/file?

Would it be possible to be perform 1 search (i.e. a single search match output window) with the following criteria:

  • find in all files matching pattern "foobar"
  • find only in one specific file matching pattern "barbaz"

Basically, combine a single search result of two different search strategies?

Or would it be possible to perform one search and append another search result to the output window?

 

thanks :-)

1
6 comments

Hi there,

Since I'm not 100% sure on what exactly is required .. I'm thinking of 2 possible options:

1) use custom scope -- there you can define patterns (for file/folder names) or even include/exclude manually on per file/folder basis

2) Perform 1st search; invoke search again and choose "Files in Previous Search Results" as a scope -- you can now search for different text/specify different file name mask

1

> Since I'm not 100% sure on what exactly is required 

Ok, I'll try again.

I want one search result where I can show the result of a) find pattern "foo" in all files and b) find pattern "bar" in only a selected scope. I think it's like performing two different searches but showing both results in a single united view.

Your suggestion 1), just the custom scope, is something different.

Suggestion 2) is pretty cool but also different (but I didn't know about, thanks!).

- Markus

0

>I think it's like performing two different searches but showing both results in a single united view.

That's not possible unfortunately (at very least as far as my knowledge goes).

You may pin search result tab so that new search will be shown in separate tab .. but that's about it.

0
Avatar
Permanently deleted user

Maybe a regular expression would be an option too?

0

But how would you make a regex where different part of the regex apply to different scopes, is that possible?

 

0

Thanks Andriy Bazanov . Creating custom scope helped me search for patterns in specific files.

0

Please sign in to leave a comment.