in reply to Re^2: Memory use/leak with large number of (?{}) patterns in regex
in thread Memory use/leak with large number of (?{}) patterns in regex
Could saving the capture indices be lazily done, with some kind of "regex in use" flag set on the regex, such that recursively executing the same regex causes the capture indices to be preserved, but only if really needed?
This would slightly add to the general regex overhead, from needing to check the "regex in use" flag on every pattern match, but perhaps that could be folded into the existing logic that handles compiling patterns when needed?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Memory use/leak with large number of (?{}) patterns in regex
by dave_the_m (Monsignor) on Nov 25, 2019 at 09:15 UTC |