Matthew Barnett added the comment:
It's definitely a bug.
In order for the pattern to match, the negative lookaround must match, which
means that its subexpression mustn't match, so none of the groups in that
subexpression have captured.
--
versions: +Python 3.10
__
New submission from Jirka Marsik :
When you have capture groups inside a negative lookaround assertion, the
strings captured by those capture groups can sometimes survive the failure of
the assertion and feature in the returned Match object.
Here it is illustrated with lookbehinds and lookahe