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
4221c74c
Commit
4221c74c
authored
Mar 02, 2009
by
Gregory P. Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged r70088 from trunk (re documentation update)
parent
85685e97
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 @
4221c74c
...
...
@@ -460,19 +460,23 @@ form.
The sequence ::
prog = re.compile(pat)
result = prog.match(str)
prog = re.compile(pat
tern
)
result = prog.match(str
ing
)
is equivalent to ::
result = re.match(pat
, str
)
result = re.match(pat
tern, string
)
but the version using :func:`compile` is more efficient when the expression
will be used several times in a single program.
but using :func:`compile` and saving the resulting regular expression object
for reuse is more efficient when the expression will be used several times
in a single program.
.. (The compiled version of the last pattern passed to :func:`re.match` or
:func:`re.search` is cached, so programs that use only a single regular
expression at a time needn't worry about compiling regular expressions.)
.. note::
The compiled versions of the most recent patterns passed to
:func:`re.match`, :func:`re.search` or :func:`re.compile` are cached, so
programs that use only a few regular expressions at a time needn't worry
about compiling regular expressions.
.. data:: A
...
...
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