[Python-checkins] cpython (2.7): Fix closes Issue14258 - Clarify the re.LOCALE and re.UNICODE flags for \S

senthil.kumaran python-checkins at python.org
Tue Apr 10 21:23:21 CEST 2012


http://hg.python.org/cpython/rev/4d49a2415ced
changeset: 76225:4d49a2415ced
branch: 2.7
user: Senthil Kumaran <senthil at uthcode.com>
date: Wed Apr 11 03:22:58 2012 +0800
summary:
 Fix closes Issue14258 - Clarify the re.LOCALE and re.UNICODE flags for \S class
files:
 Doc/library/re.rst | 24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -353,20 +353,20 @@
 character properties database.
 
 ``\s``
- When the :const:`LOCALE` and :const:`UNICODE` flags are not specified, matches
- any whitespace character; this is equivalent to the set ``[ \t\n\r\f\v]``. With
- :const:`LOCALE`, it will match this set plus whatever characters are defined as
- space for the current locale. If :const:`UNICODE` is set, this will match the
- characters ``[ \t\n\r\f\v]`` plus whatever is classified as space in the Unicode
- character properties database.
+ When the :const:`UNICODE` flag is not specified, it matches any whitespace
+ character, this is equivalent to the set ``[ \t\n\r\f\v]``. The
+ :const:`LOCALE` flag has no extra effect on matching of the space.
+ If :const:`UNICODE` is set, this will match the characters ``[ \t\n\r\f\v]``
+ plus whatever is classified as space in the Unicode character properties
+ database.
 
 ``\S``
- When the :const:`LOCALE` and :const:`UNICODE` flags are not specified,
- matches any non-whitespace character; this is equivalent to the set ``[^
- \t\n\r\f\v]`` With :const:`LOCALE`, it will match the above set plus any
- non-space character in the current locale. If :const:`UNICODE` is set, the
- above set ``[^ \t\n\r\f\v]`` plus the characters not marked as space in the
- Unicode character properties database.
+ When the :const:`UNICODE` flags is not specified, matches any non-whitespace
+ character; this is equivalent to the set ``[^ \t\n\r\f\v]`` The
+ :const:`LOCALE` flag has no extra effect on non-whitespace match. If
+ :const:`UNICODE` is set, then any character not marked as space in the
+ Unicode character properties database is matched.
+
 
 ``\w``
 When the :const:`LOCALE` and :const:`UNICODE` flags are not specified, matches
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /