This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #22395] regexp /(.*)[bc]/ 10000 times slower in 5.8.0 vs 5.6.1
[perl5.git] / regcomp.c
index a69d0b3..f8052a1 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -4207,7 +4207,8 @@ reStudy:
            first = NEXTOPER(first);
            goto again;
        }
-       else if (!sawopen && (OP(first) == STAR &&
+       else if ((!sawopen || !RExC_sawback) &&
+           (OP(first) == STAR &&
            PL_regkind[OP(NEXTOPER(first))] == REG_ANY) &&
            !(r->reganch & ROPT_ANCH) )
        {