Question

Search for all files *not* containing a string in VS Code

In Visual Studio Code, using the search capability, how can I search for all files that do not contain a certain string? In this case - "OnPush"

 46  55716  46
1 Jan 1970

Solution

 42

In general regex, to search for anything that does not contain a certain string, you do stringbefore(?!string) That is a negative lookahead, it says that only match if whatever you specify as string is not present. In your case it would be something like [\W\w]+(?!OnPush)

But, Negative Lookaheads aren't supported in VS Code Search... So you can't do much.

2018-07-11

Solution

 13

There is a VS Code extension called Reverse Search It can find files that do not contain a specific string

2019-10-21