Find 'Not Found' Matches in list
-
I am trying to search for ‘string’ (ex:‘var’) +‘X digit of numbers’ (ex: 4) from 0000 to a specified value’ (ex: 1999).
var0000
var0001
…
var1999I am trying to find which ones are not found in all of the opened files in Notepad++.
(or the first one that is not found)I tried this with multireplace, but I was not successful.
I am asking here for help if there is a way to do this and how.
Thanks. -
Hello @fern99 and All,
I think that the regex, below, should work properly !
-
It will list, in the Find Results panel, all the files which do NOT contain any string from
var0000
tovar1999
, at any position, in files. -
Foe each file listed, It will highlight the very first character of current file.
FIND
(?s-i)\A(?=.*var[01][0-9]{3})(*SKIP)(*F)|\A.
Remark : Do NOT use the almost identical regex
(?s-i)\A(?=.*var[01][0-9]{3})(*SKIP)(*F)|\A
, without the final regex dot.
! There’s, somehow, a bug, as running successively this pseudo-regex does NOT return the same results !Best Regards,
guy038
-
-
@guy038 said in Find 'Not Found' Matches in list:
I think that the regex, below, should work properly !
I think you have the wrong interpretation of the question.
I see it like the numbers from 0000 to 1999 exist except say 0002 and 0007. OP wants whichever is the first missing number.
Let’s say it is 0007.I think this can only be solved by a programming language such as pythonscript.
Terry
PS actually it has to be 0002 if testing in numerical order. OP needs to expand on detail.
-
I am puzzling over the subject line
Find 'Not Found' Matches in list
which implies there is a list of things to search for. The desire is to scan the list and to stop scanning as soon a something in that list is not found.In the post body @Fern99 provides what seems to be an “example” of the list which could be be constructed on the fly by with the text string `var’ followed by the numeric values 0000 up to 1999.
Either way, a list of things in a file, or a programmatically generated list, involves scripting which is outside the scope of Notepad++.
I also believe that BOOST has issues with scanning an entire file for not-something. For example,
(?s-i)\A^((?!var0000).)*$
starts misbehaving when a random text file was over 35000 characters and would also stop when it hit extended Unicode characters.