aryla · GitHub

Bug report

The following code raises a SystemError.

import re
re.match('((x)|y|z)*+', 'xyz')

Error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Arttu\AppData\Local\Programs\Python\Python311\Lib\re\__init__.py", line 166, in match
    return _compile(pattern, flags).match(string)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: The span of capturing group is wrong, please report a bug for the re module.

((x)|y|z)++ gives the same error but (?>((x)|y|z)*) does not.

Your environment

Python 3.11.2 (tags/v3.11.2:878ead1, Feb 7 2023, 16:38:35) [MSC v.1934 64 bit (AMD64)] on win32

Linked PRs

Read the original on github.com ↗