Hello, bill clinton and Gerdb42,
If I refer to the original text, posted by bill clinton, below :
https://notepad-plus-plus.org/community/topic/11716/help-with-formula-please/1
it seems, that there are two spaces between the words Log and Quantity, as well as between the Qty number and the LastAccess string.
So, rather that typing two spaces, we may use a SPACE, followed by the + quantifier ( identical to the syntax {1,}) )
That comes to the regex :
(?-i)Log +Quantity +\K\d+(?! +LastAccess)
Notes :
You’ll notice that I did NOT use the following look-behind (?<=Log +Quantity +). Indeed it’s an invalid regular expression, because this regex may represent strings of different length ( due to the + quantifier )
It is important to notice that this restriction does NOT apply to look-aheads, as ( (?! +LastAccess) )
So, I replaced the look-behind with the \K construction. Thus, once, the regex has matched the regex Log +Quantity +,
this string is forgotten and the regex engine match is reset to a zero length string !
Finally, the (?-i) modifier, at the beginning, forces the regex engine to perform a NON insensitive case search
Best Regards,
guy038