Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions Doc/library/re.rst
Original file line number Diff line number Diff line change
Expand Up @@ -915,10 +915,15 @@ Functions

.. note::

The compiled versions of the most recent patterns passed to
:func:`re.compile` and the module-level matching functions are cached, so
programs that use only a few regular expressions at a time needn't worry
about compiling regular expressions.
In addition to caching patterns passed to :func:`re.compile`,
the module maintains a small internal cache of regular
expressions passed to matching functions such as
:func:`re.search`, :func:`re.match`, and :func:`findall`,
even if the regular expressions were passed to
those functions as strings. Therefore, programs that use only
a few regular expressions at a time needn't worry about
compiling regular expressions.



.. function:: search(pattern, string, flags=0)
Expand Down
Loading