Skip to content

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

Merged
JelleZijlstra merged 1 commit into
python: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 into
python:mainfrom
mohsinm-dev:fix-match-group-doc-range

Conversation

@mohsinm-dev

@mohsinm-devmohsinm-dev commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

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.

@serhiy-storchakaserhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. 👍

Comment threadDoc/library/re.rst
@JelleZijlstra
JelleZijlstra merged commit 85021bc into python:mainFeb 21, 2026
48 checks passed
@miss-islington-app

Copy link
Copy Markdown

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-automationgithub-project-automationBot moved this from Todo to Done in Docs PRsFeb 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 85021bc)
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 85021bc)
Co-authored-by: Mohsin Mehmood <55545648+mohsinm-dev@users.noreply.github.com>
@bedevere-app

Copy link
Copy Markdown

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

@bedevere-appbedevere-appBot removed the needs backport to 3.14 bugs and security fixes label Feb 21, 2026
@bedevere-app

Copy link
Copy Markdown

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

@bedevere-appbedevere-appBot 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>
brijkapadia pushed a commit to brijkapadia/cpython that referenced this pull request Feb 28, 2026
python#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.
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
python#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.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docsDocumentation in the Doc dirskip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants

@mohsinm-dev@JelleZijlstra@caje731@serhiy-storchaka