JD.
JD.

Reputation: 15531

Find all folders excluding some paths

In visual studio when searching for files, how can I find all files that do not contain a certain string in their directory path or file name?

For example:

I want to find all files that have the word MainRegion but I do not want files such as:

c:\myfiles\file1Fixture.cs
c:\myfiles\somedirectory\a.b.tests\filename.xaml

So I want to exclude file names with "Fixture" in and directory paths with "tests" in.

JD

Upvotes: 0

Views: 234

Answers (1)

Tim Pietzcker
Tim Pietzcker

Reputation: 336078

^.*\\[^\\]*Fixture[^\\]*$

should match files that contain Fixture in the file name (but not in the path).

^.*tests.*\\[^\\]*$

should match files that contain tests in the path, but not in the filename.

Upvotes: 1

Related Questions