File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -915,10 +915,15 @@ Functions
915
915
916
916
.. note ::
917
917
918
- The compiled versions of the most recent patterns passed to
919
- :func: `re.compile ` and the module-level matching functions are cached, so
920
- programs that use only a few regular expressions at a time needn't worry
921
- about compiling regular expressions.
918
+ In addition to caching patterns passed to :func: `re.compile `,
919
+ the module maintains a small internal cache of regular
920
+ expressions passed to matching functions such as
921
+ :func: `re.search `, :func: `re.match `, and :func: `findall `,
922
+ even if the regular expressions were passed to
923
+ those functions as strings. Therefore, programs that use only
924
+ a few regular expressions at a time needn't worry about
925
+ compiling regular expressions.
926
+
922
927
923
928
924
929
.. function :: search(pattern, string, flags=0)
You can’t perform that action at this time.
0 commit comments