mirror of
https://github.com/python/cpython.git
synced 2025-08-10 11:58:39 +00:00
[3.12] gh-118508: Clarify which characters are matched by \s
(GH-119155) (#123671)
gh-118508: Clarify which characters are matched by `\s` (GH-119155)
Clarify re syntax
(cherry picked from commit 22fdb8cf89
)
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
This commit is contained in:
parent
e75ecd0b42
commit
a0c9f51561
1 changed files with 3 additions and 4 deletions
|
@ -600,10 +600,9 @@ character ``'$'``.
|
||||||
|
|
||||||
``\s``
|
``\s``
|
||||||
For Unicode (str) patterns:
|
For Unicode (str) patterns:
|
||||||
Matches Unicode whitespace characters (which includes
|
Matches Unicode whitespace characters (as defined by :py:meth:`str.isspace`).
|
||||||
``[ \t\n\r\f\v]``, and also many other characters, for example the
|
This includes ``[ \t\n\r\f\v]``, and also many other characters, for example the
|
||||||
non-breaking spaces mandated by typography rules in many
|
non-breaking spaces mandated by typography rules in many languages.
|
||||||
languages).
|
|
||||||
|
|
||||||
Matches ``[ \t\n\r\f\v]`` if the :py:const:`~re.ASCII` flag is used.
|
Matches ``[ \t\n\r\f\v]`` if the :py:const:`~re.ASCII` flag is used.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue