Skip to content

docs: re.Match.group() does handle numbers >99 #144694

Closed

Description

@cben

Documentation

https://docs.python.org/3.14/library/re.html#re.Match.group

if it [groupN arg] is in the inclusive range [1..99], it is the string matching the corresponding parenthesized group.

Unlike \1..\99 notation, .group() is not constrained by 99.
It was constrained up to Python 3.4 (AssertionError: sorry, but this version only supports 100 named groups)
but not since 3.5 (9baa5b2, https://bugs.python.org/issue22437):

>>> re.search('()'*999 + '(y)', 'xy').group(99, 999, 1000)
('', '', 'y')
>>> _sre.MAXGROUPS
1073741823

Linked PRs

Activity

  1. added
    docsDocumentation in the Doc dir
    on Feb 10, 2026
  2. added a commit that references this issue on Feb 11, 2026
  3. added
    3.13only security fixes
    3.14bugs and security fixes
    3.15bugs and security fixes
    on Feb 11, 2026
  4. added a commit that references this issue on Feb 21, 2026
  5. added 2 commits that reference this issue on Feb 21, 2026
  6. added 2 commits that reference this issue on Feb 21, 2026
  7. added a commit that references this issue on Feb 28, 2026
  8. added a commit that references this issue on Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13only security fixes3.14bugs and security fixes3.15bugs and security fixesdocsDocumentation in the Doc dirtopic-regex

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions