summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorStanley <46876382+slateny@users.noreply.github.com>2022-12-20 03:07:31 (GMT)
committerGitHub <noreply@github.com>2022-12-20 03:07:31 (GMT)
commit36a0b1d0dddbdf324d98071ea31e7e9151eea6d5 (patch)
tree012cdf91944c19817fb53f77ad2e652abe34e5ed /Doc/library
parent797edb28c3dd02a5727f0374e937e906a389ab77 (diff)
downloadcpython-36a0b1d0dddbdf324d98071ea31e7e9151eea6d5.zip
cpython-36a0b1d0dddbdf324d98071ea31e7e9151eea6d5.tar.gz
cpython-36a0b1d0dddbdf324d98071ea31e7e9151eea6d5.tar.bz2
gh-69929: re docs: Add more specific definition of \w (#92015)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/re.rst7
1 files changed, 3 insertions, 4 deletions
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index f7d4658..cbee70b 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -591,10 +591,9 @@ character ``'$'``.
``\w``
For Unicode (str) patterns:
- Matches Unicode word characters; this includes most characters
- that can be part of a word in any language, as well as numbers and
- the underscore. If the :const:`ASCII` flag is used, only
- ``[a-zA-Z0-9_]`` is matched.
+ Matches Unicode word characters; this includes alphanumeric characters (as defined by :meth:`str.isalnum`)
+ as well as the underscore (``_``).
+ If the :const:`ASCII` flag is used, only ``[a-zA-Z0-9_]`` is matched.
For 8-bit (bytes) patterns:
Matches characters considered alphanumeric in the ASCII character set;