-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Add example of named group to re.Match.__getitem__ doc #92727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
bmispelon
added a commit
to bmispelon/cpython
that referenced
this issue
May 12, 2022
+1 This is a nice improvement. |
rhettinger
pushed a commit
that referenced
this issue
May 28, 2022
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
May 28, 2022
…tem__ (pythonGH-92730) (cherry picked from commit 642d1fa) Co-authored-by: Baptiste Mispelon <bmispelon@gmail.com>
miss-islington
added a commit
that referenced
this issue
May 28, 2022
Resolved per #92730. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Documentation
The documentation for
re.Match.__getitem__
only shows example of using positional capture groups (likematchobj[1]
) but not named groups (likematchobj['foo']
).It mentions that "[...] is identical to m.group(g)" so you can infer that named groups work, but I think having an explicit example would encourage the adoption of the feature.
The text was updated successfully, but these errors were encountered: