From c9194d8a88db1adb72a5046b6af7ac69e27961aa Mon Sep 17 00:00:00 2001 From: ph10 Date: Fri, 27 Jul 2018 16:42:25 +0000 Subject: [PATCH] Allow for #pattern -no_start_optimize in perltest script. --- perltest.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/perltest.sh b/perltest.sh index b851088..64ae633 100755 --- a/perltest.sh +++ b/perltest.sh @@ -46,6 +46,7 @@ fi # mark show mark information # no_auto_possess ignored # no_start_optimize insert (??{""}) at pattern start (disables optimizing) +# -no_start_optimize ignored # subject_literal does not process subjects for escapes # ucp sets Perl's /u modifier # utf invoke UTF-8 functionality @@ -231,8 +232,10 @@ for (;;) $mod =~ s/no_auto_possess,?//; # Use no_start_optimize (disable PCRE2 start-up optimization) to disable Perl - # optimization by inserting (??{""}) at the start of the pattern. - + # optimization by inserting (??{""}) at the start of the pattern. We may + # also encounter -no_start_optimize from a #pattern setting. + + $mod =~ s/-no_start_optimize,?//; if ($mod =~ s/no_start_optimize,?//) { $pat =~ s/$del/$del(??{""})/; } # Add back retained modifiers and check that the pattern is valid.