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 _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/6TFZUC4UWH2GJDYD3QBH76FRAVRNOYNL/ Code of Conduct: http://python.org/psf/codeofconduct/