https://github.com/python/cpython/commit/11c61b52d30e413a58db296eec97949c2c7d8fe4
commit: 11c61b52d30e413a58db296eec97949c2c7d8fe4
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: JelleZijlstra <[email protected]>
date: 2026-02-21T05:42:39Z
summary:

[3.13] gh-144694: Fix re.Match.group() doc claiming [1..99] range limit 
(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 85021bc2477f3ab394172b6dda3110e59f4777dd)

Co-authored-by: Mohsin Mehmood <[email protected]>

files:
M Doc/library/re.rst

diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index 7a43723e119e5e..efebc819ddaf7c 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -1404,10 +1404,10 @@ when there is no match, you can test whether there was 
a match with a simple
    result is a single string; if there are multiple arguments, the result is a
    tuple with one item per argument. Without arguments, *group1* defaults to 
zero
    (the whole match is returned). If a *groupN* argument is zero, the 
corresponding
-   return value is the entire matching string; if it is in the inclusive range
-   [1..99], it is the string matching the corresponding parenthesized group.  
If a
-   group number is negative or larger than the number of groups defined in the
-   pattern, an :exc:`IndexError` exception is raised. If a group is contained 
in a
+   return value is the entire matching string; if it is a positive integer, it 
is
+   the string matching the corresponding parenthesized group.  If a group 
number is
+   negative or larger than the number of groups defined in the pattern, an
+   :exc:`IndexError` exception is raised. If a group is contained in a
    part of the pattern that did not match, the corresponding result is 
``None``.
    If a group is contained in a part of the pattern that matched multiple 
times,
    the last match is returned. ::

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to