Branch: refs/heads/yves/optimistic_eval Home: https://github.com/Perl/perl5 Commit: 9768b35ca0c67fe2b29655fe2ccbc897df0ee263 https://github.com/Perl/perl5/commit/9768b35ca0c67fe2b29655fe2ccbc897df0ee263 Author: Yves Orton <demer...@gmail.com> Date: 2023-01-15 (Sun, 15 Jan 2023)
Changed paths: M pod/perldelta.pod M pod/perlre.pod M regcomp.c M regcomp.h M regcomp_debug.c M regcomp_internal.h M regcomp_study.c M regexec.c M regnodes.h M t/re/pat_re_eval.t M t/re/pat_rt_report.t M toke.c Log Message: ----------- regcomp.c - add optimistic eval (*{ ... }) and (**{ ... }) This adds (*{ ... }) and (**{ ... }) as equivalents to (?{ ... }) and (??{ ... }). The only difference being that the star variants are "optimisitic" and are defined to never disable optimisations. This is especially relevant now that use of (?{ ... }) prevents important optimisations anywhere in the pattern, instead of the older and inconsistent rules where it only affected the parts that contained the EVAL. It is also very useful for injecting debugging style expressions to the pattern to understand what the regex engine is actually doing. The older style (?{ ... }) variants would change the regex engines behavior, meaning this was not as effective a tool as it could have been. Similarly it is now possible to test that a given regex optimisation works correctly using (*{ ... }), which was not possible with (?{ ... }).