From 22fdb8cf899d2dd29f2ac0bf61309af6809719fb Mon Sep 17 00:00:00 2001 From: Nice Zombies Date: Mon, 2 Sep 2024 13:48:15 +0200 Subject: [PATCH] gh-118508: Clarify which characters are matched by `\s` (#119155) Clarify re syntax --- Doc/library/re.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Doc/library/re.rst b/Doc/library/re.rst index cc979fe66f7..efb2722f180 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.