Skip to content

Comments

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

Merged
JelleZijlstra merged 1 commit intopython:mainfrom
mohsinm-dev:fix-match-group-doc-range
Feb 21, 2026
Merged

gh-144694: Fix re.Match.group() doc claiming [1..99] range limit#144696
JelleZijlstra merged 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
@JelleZijlstra JelleZijlstra merged commit 85021bc into python:main Feb 21, 2026
48 checks passed
@miss-islington-app
Copy link

Thanks @mohsinm-dev for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Feb 21, 2026
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 21, 2026
pythonGH-144696)

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.
(cherry picked from commit 85021bc2477f3ab394172b6dda3110e59f4777dd)

Co-authored-by: Mohsin Mehmood <55545648+mohsinm-dev@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 21, 2026
pythonGH-144696)

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.
(cherry picked from commit 85021bc2477f3ab394172b6dda3110e59f4777dd)

Co-authored-by: Mohsin Mehmood <55545648+mohsinm-dev@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Feb 21, 2026

GH-145065 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Feb 21, 2026
@bedevere-app
Copy link

bedevere-app bot commented Feb 21, 2026

GH-145066 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Feb 21, 2026
JelleZijlstra pushed a commit that referenced this pull request Feb 21, 2026
…it (GH-144696) (#145065)

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

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.
(cherry picked from commit 85021bc)

Co-authored-by: Mohsin Mehmood <55545648+mohsinm-dev@users.noreply.github.com>
JelleZijlstra pushed a commit that referenced this pull request Feb 21, 2026
…it (GH-144696) (#145066)

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

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.
(cherry picked from commit 85021bc)

Co-authored-by: Mohsin Mehmood <55545648+mohsinm-dev@users.noreply.github.com>
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 skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants