Skip to content

Commit 02c8cc3

Browse files
slatenyJelleZijlstra
authored andcommitted
pythongh-69929: re docs: Add more specific definition of \w (pythonGH-92015)
(cherry picked from commit 36a0b1d) Co-authored-by: Stanley <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
1 parent e38a525 commit 02c8cc3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Doc/library/re.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,10 +526,9 @@ character ``'$'``.
526526

527527
``\w``
528528
For Unicode (str) patterns:
529-
Matches Unicode word characters; this includes most characters
530-
that can be part of a word in any language, as well as numbers and
531-
the underscore. If the :const:`ASCII` flag is used, only
532-
``[a-zA-Z0-9_]`` is matched.
529+
Matches Unicode word characters; this includes alphanumeric characters (as defined by :meth:`str.isalnum`)
530+
as well as the underscore (``_``).
531+
If the :const:`ASCII` flag is used, only ``[a-zA-Z0-9_]`` is matched.
533532

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

0 commit comments

Comments
 (0)