
Feb. 15, 2022
1:53 p.m.
On Tue, Feb 15, 2022 at 05:39:33AM -0600, Tim Peters wrote:
([^s]|s(?!pam))*spam
Bingo. That pattern is easy enough to understand
You and I have very different definitions of the word "easy" :-)
(if not to invent the first time): we can chew up a character if it's not an "s", or if it is an "s" but one _not_ followed immediately by "pam".
It is times like this that I am reminded why I prefer to just call string.find("spam") :-) -- Steve