I was wondering if it was possible to list an exclusion within the file filters in the "find in files" functionality of Notepad++.
For example the following will replace Dog with Cat in all files.
Find what: Dog
Replace with: Cat
Filters: *.*
What I would like to do is replace Dog with Cat in all files except those in .sh files.
Is this possible?
I think something like a "negative selector" does not exist in Notepad++.
I took a quick look at the 5.6.6 source code and it seems like the file selection mechanism boils down to a function called getMatchedFilenames()
which recursively runs through all the files below a certain directory, which in turn calls the following function to see whether the filename matches the pattern:
bool Notepad_plus::matchInList(const TCHAR *fileName, const vector<generic_string> & patterns)
{
for (size_t i = 0 ; i < patterns.size() ; i++)
{
if (PathMatchSpec(fileName, patterns[i].c_str()))
return true;
}
return false;
}
As far as I can determine, PathMatchSpec does not allow negative selectors.
It is however possible to enter a list of positive filters. If you could make that list long enough to include all the extensions in your directory except .sh
, you're also there.
Good luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With