Stefan Ram wrote:
One can count overlapping occurences as follows.
|>>> print(len(findall('(?=aa)','caaaab')))
|3
Every web page says that lookahead assertions do
not consume nor move the "current position".
But what mental model can I make of the regex
engine that explains why it is not caught in an
endless loop matching "aa" at the same position
again and again and never advancing to the other
occurences?
(Something with nondeterminism?)
Old but EXCELLENT insight into how regular expressions works:
https://perl.plover.com/yak/regex/
(pdf and html slides)
--
https://mail.python.org/mailman/listinfo/python-list