Skip to content

SystemError in re.match with a "*+" pattern #101955

Closed

Description

@aryla

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

Activity

  1. added
    type-bug
    on Feb 16, 2023
  2. uyw4687 commented on Mar 6, 2023

    @uyw4687
    Contributor

    I'll look into it

  3. added
    3.12
    on Mar 6, 2023
  4. corona10 commented on Mar 6, 2023

    @corona10
    Member

    I'll look into it

    Please go a head

  5. added a commit that references this issue on Oct 26, 2023
  6. added a commit that references this issue on Nov 18, 2024
  7. added 2 commits that reference this issue on Nov 18, 2024
  8. serhiy-storchaka commented on Nov 18, 2024

    @serhiy-storchaka
    Member

    Thanks @wjssz. The final code is his contribution.

  9. added 2 commits that reference this issue on Nov 18, 2024
  10. added a commit that references this issue on Jan 12, 2025
  11. added 2 commits that reference this issue on Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

3.113.12topic-regextype-bug

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions