Skip to content

Commit b81d1c3

Browse files
miss-islingtonslatenyJelleZijlstra
authored
gh-69929: re docs: Add more specific definition of \w (GH-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 e38a525 commit b81d1c3

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
@@ -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)