]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-118508: Clarify which characters are matched by `\s` (GH-119155) (#123671)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 4 Sep 2024 22:36:39 +0000 (00:36 +0200)
committerGitHub <noreply@github.com>
Wed, 4 Sep 2024 22:36:39 +0000 (15:36 -0700)
gh-118508: Clarify which characters are matched by `\s` (GH-119155)

Clarify re syntax
(cherry picked from commit 22fdb8cf899d2dd29f2ac0bf61309af6809719fb)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Doc/library/re.rst

index 813afcc483a28ee621bd6380d3c57b576448c76a..3c9b99c6438a1736b417e5321a7569237f6a2e14 100644 (file)
@@ -600,10 +600,9 @@ character ``'$'``.
 
 ``\s``
    For Unicode (str) patterns:
-      Matches Unicode whitespace characters (which includes
-      ``[ \t\n\r\f\v]``, and also many other characters, for example the
-      non-breaking spaces mandated by typography rules in many
-      languages).
+      Matches Unicode whitespace characters (as defined by :py:meth:`str.isspace`).
+      This includes ``[ \t\n\r\f\v]``, and also many other characters, for example the
+      non-breaking spaces mandated by typography rules in many languages.
 
       Matches ``[ \t\n\r\f\v]`` if the :py:const:`~re.ASCII` flag is used.