From: Senthil Kumaran Date: Tue, 10 Apr 2012 19:22:58 +0000 (+0800) Subject: Fix closes Issue14258 - Clarify the re.LOCALE and re.UNICODE flags for \S class X-Git-Tag: v2.7.4rc1~911^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc0b324a0f73692e90fe999260f1d0f3c8371147;p=python Fix closes Issue14258 - Clarify the re.LOCALE and re.UNICODE flags for \S class --- diff --git a/Doc/library/re.rst b/Doc/library/re.rst index d64604f6df..02251cf9d5 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -353,20 +353,20 @@ the second character. For example, ``\$`` matches the character ``'$'``. 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