summaryrefslogtreecommitdiffstats
path: root/Modules/_sre/sre.h
Commit message (Collapse)AuthorAgeFilesLines
* gh-67877: Fix memory leaks in terminated RE matching (GH-126840)Serhiy Storchaka2024-11-181-1/+16
| | | | | | | | If SRE(match) function terminates abruptly, either because of a signal or because memory allocation fails, allocated SRE_REPEAT blocks might be never released. Co-authored-by: <wjssz@users.noreply.github.com>
* gh-109631: Allow interruption of short repeated regex matches (GH-109867)Serhiy Storchaka2023-09-261-0/+1
| | | | Counting for signal checking now continues in new match from the point where it ended in the previous match instead of starting from 0.
* gh-106508: Improve debugging of the _sre module (GH-106509)Serhiy Storchaka2023-07-081-0/+1
| | | | | | | Now the VERBOSE macro can control tracing on per-pattern basis: * 0 -- disabled * 1 -- only if the DEBUG flag set * 2 -- always
* gh-91524: Speed up the regular expression substitution (#91525)Serhiy Storchaka2022-10-231-0/+11
| | | | | | | | | Functions re.sub() and re.subn() and corresponding re.Pattern methods are now 2-3 times faster for replacement strings containing group references. Closes #91524 Primarily authored by serhiy-storchaka Serhiy Storchaka Minor-cleanups-by: Gregory P. Smith [Google] <greg@krypto.org>
* gh-91404: Revert "bpo-23689: re module, fix memory leak when a match is ↵Gregory P. Smith2022-06-171-4/+0
| | | | | | | | | | | | terminated by a signal or allocation failure (GH-32283) (#93882) Revert "bpo-23689: re module, fix memory leak when a match is terminated by a signal or memory allocation failure (GH-32283)" This reverts commit 6e3eee5c11b539e9aab39cff783acf57838c355a. Manual fixups to increase the MAGIC number and to handle conflicts with a couple of changes that landed after that. Thanks for reviews by Ma Lin and Serhiy Storchaka.
* bpo-47256: Increasing the depth of backtracking in RE (GH-32411)Ma Lin2022-04-181-6/+6
| | | | | | | | | | Limit the maximum capturing group to 2**30-1 on 64-bit platforms (it was 2**31-1). No change on 32-bit platforms (2**28-1). It allows to reduce the size of SRE(match_context): - On 32 bit platform: 36 bytes, no change. (msvc2022) - On 64 bit platform: 72 bytes -> 56 bytes. (msvc2022/gcc9.4) which leads to increasing the depth of backtracking.
* bpo-47152: Move sources of the _sre module into a subdirectory (GH-32290)Serhiy Storchaka2022-04-041-0/+99