Skip to content

Commit

Permalink
Update Doc/howto/regex.rst
Browse files Browse the repository at this point in the history
Co-authored-by: Guido van Rossum <[email protected]>
  • Loading branch information
akuchling and gvanrossum authored Sep 25, 2024
1 parent 961a4ef commit b0258f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Doc/howto/regex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1022,8 +1022,8 @@ module::
r' (?P<zonen>[-+])(?P<zoneh>[0-9][0-9])(?P<zonem>[0-9][0-9])'
r'"')

It's much easier to write ``m.group('zonem')``, instead of having
to remember to retrieve group 9.
It's much easier to write ``m.group('zonem')`` instead of having
to count groups so as to verify we must retrieve group 9.

The syntax for backreferences in an expression such as ``(...)\1`` refers to the
number of the group. There's naturally a variant that uses the group name
Expand Down

0 comments on commit b0258f6

Please sign in to comment.