views:

64

answers:

1

Hi,

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

+1  A: 
^.*\\[^\\]*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.

Tim Pietzcker
Thanks for the reply. Unfortunately, both did not work.
JD
I don't have Visual Studio. Are you sure that it can use regexes to search for filenames?
Tim Pietzcker