Skip to content

Commit ee3aeb9

Browse files
slatenyJelleZijlstra
authored andcommittedDec 20, 2022
pythongh-69929: re docs: Add more specific definition of \w (pythonGH-92015)
(cherry picked from commit 36a0b1d) Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
1 parent c42a4ad commit ee3aeb9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

‎Doc/library/re.rst

+3-4
Original file line numberDiff line numberDiff line change
@@ -589,10 +589,9 @@ character ``'$'``.
589589

590590
``\w``
591591
For Unicode (str) patterns:
592-
Matches Unicode word characters; this includes most characters
593-
that can be part of a word in any language, as well as numbers and
594-
the underscore. If the :const:`ASCII` flag is used, only
595-
``[a-zA-Z0-9_]`` is matched.
592+
Matches Unicode word characters; this includes alphanumeric characters (as defined by :meth:`str.isalnum`)
593+
as well as the underscore (``_``).
594+
If the :const:`ASCII` flag is used, only ``[a-zA-Z0-9_]`` is matched.
596595

597596
For 8-bit (bytes) patterns:
598597
Matches characters considered alphanumeric in the ASCII character set;

0 commit comments

Comments
 (0)
Please sign in to comment.