From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 4 Sep 2024 22:36:14 +0000 (+0200) Subject: [3.13] gh-118508: Clarify which characters are matched by `\s` (GH-119155) (#123670) X-Git-Tag: v3.13.0rc2~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b37658646926330cc2de6b1da2e780e4876949d;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-118508: Clarify which characters are matched by `\s` (GH-119155) (#123670) gh-118508: Clarify which characters are matched by `\s` (GH-119155) Clarify re syntax (cherry picked from commit 22fdb8cf899d2dd29f2ac0bf61309af6809719fb) Co-authored-by: Nice Zombies --- diff --git a/Doc/library/re.rst b/Doc/library/re.rst index cc979fe66f7f..efb2722f1803 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -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.