Hello, @djmcg, @scott-sumner and All,
I said, in that other post, below, that finding all files, which do not contain a specific string, was not easy, with our Boost regex engine and that we need to use a work-around to get the right results. However, we can easily build a regex which find all lines of files, which do not contain a specific string ! And, then, delete them, as and when :-))
https://notepad-plus-plus.org/community/topic/14870/regex-find-all-files-that-do-not-contain-some-words/2
In your example, this specific string seems to be the number 300000, preceded by a semicolon
So, the regex S/R, below, should keep only lines containing the string ;300000 :
SEARCH (?-s)(?!.*;300000)^.*\R
REPLACE Leave EMPTY
OPTIONS Regular expression and Wrap around checked
=> It remains, only lines that contain the string ;300000. Et voilà !
Notes :
The first part (?-s) modifier means that dot will match any standard character, only and NOT the line breaks
The last part ^.*\R is the range of characters to search for, that is to say, all characters of a line, even empty, along with its End of Line character(s)
And, thanks to the middle part (?!.*;300000), which is a negative look-ahead, this search will be true, ONLY IF the string ;300000 cannot be found, from beginning of line, in the current line scanned
And, as the Replacement part is empty, these lines are simply deleted
As you see, you’ve got 4 solutions, to get the job done :
With the LineFilter2 plugin
With bookmarks
With the Find result panel
With regex S/R
Enjoy N++ !!
Cheers,
guy038