Skip to content

gh-144694: Fix re.Match.group() doc claiming [1..99] range limit#144696

Open
mohsinm-dev wants to merge 1 commit intopython:mainfrom
mohsinm-dev:fix-match-group-doc-range
Open

gh-144694: Fix re.Match.group() doc claiming [1..99] range limit#144696
mohsinm-dev wants to merge 1 commit intopython:mainfrom
mohsinm-dev:fix-match-group-doc-range

Conversation

@mohsinm-dev
Copy link
Contributor

@mohsinm-dev mohsinm-dev commented Feb 11, 2026

The documentation for re.Match.group() incorrectly states that numeric group arguments must be in the inclusive range [1..99]. This limit was removed in Python 3.5 (bpo-22437) when the number of capturing groups became dynamic.

Replace [1..99] with "a positive integer" since the next sentence already documents the IndexError for out-of-range values.


📚 Documentation preview 📚: https://cpython-previews--144696.org.readthedocs.build/

The documentation incorrectly stated that numeric group arguments
must be in the range [1..99]. This limit was removed in Python 3.5
(bpo-22437). Replace with "a positive integer" since the next
sentence already documents the IndexError for out-of-range values.
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes and removed awaiting merge labels Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants