Skip to content

Commit 36a0b1d

Browse files
gh-69929: re docs: Add more specific definition of \w (#92015)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
1 parent 797edb2 commit 36a0b1d

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
@@ -591,10 +591,9 @@ character ``'$'``.
591591

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

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

0 commit comments

Comments
 (0)