Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d6bc86de
Commit
d6bc86de
authored
Mar 11, 2012
by
Senthil Kumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix closes issue14258 - added clarification to \W and \S flags
parent
0a66c40a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
Doc/library/re.rst
Doc/library/re.rst
+12
-8
No files found.
Doc/library/re.rst
View file @
d6bc86de
...
...
@@ -361,12 +361,12 @@ 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 non-whitespace character; this is equivalent to the set ``[^ \t\n\r\f\v]``
With :const:`LOCALE`, it will match any character not in this set, and not
defined as space in the current locale. If :const:`UNICODE` is set, this will
match anything other than ``[ \t\n\r\f\v]`` and characters marked as space in
the
Unicode character properties database.
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.
``\w``
When the :const:`LOCALE` and :const:`UNICODE` flags are not specified, matches
...
...
@@ -381,12 +381,16 @@ the second character. For example, ``\$`` matches the character ``'$'``.
any non-alphanumeric character; this is equivalent to the set ``[^a-zA-Z0-9_]``.
With :const:`LOCALE`, it will match any character not in the set ``[0-9_]``, and
not defined as alphanumeric for the current locale. If :const:`UNICODE` is set,
this will match anything other than ``[0-9_]``
and characters mark
ed as
alphanumeric in the Unicode character properties database.
this will match anything other than ``[0-9_]``
plus characters classi
ed as
not
alphanumeric in the Unicode character properties database.
``\Z``
Matches only at the end of the string.
If both :const:`LOCALE` and :const:`UNICODE` flags are included for a
particular sequence, then :const:`LOCALE` flag takes effect first followed by
the :const:`UNICODE`.
Most of the standard escapes supported by Python string literals are also
accepted by the regular expression parser::
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment