s -= RX_GOFS(rx);
/* Are we done */
+ /* I believe that we can't set REXEC_SCREAM here if
+ SvSCREAM(cx->sb_targ) is true because SvPVX(cx->sb_targ) isn't always
+ equal to s. [See the comment before Perl_re_intuit_start(), which is
+ called from Perl_regexec_flags(), which says that it should be when
+ SvSCREAM() is true.] s, cx->sb_strend and orig will be consistent
+ with SvPVX(cx->sb_targ), as substconst doesn't modify cx->sb_targ
+ during the match. */
if (CxONCE(cx) || s < orig ||
!CALLREGEXEC(rx, s, cx->sb_strend, orig,
(s == m) + RX_GOFS(rx), cx->sb_targ, NULL,
}
watchdog(10);
-plan(tests => 30);
+plan(tests => 36);
use strict;
use vars '$x';
my @a = split /aab*/, $a;
is("@a", 'Q Q Q Q', 'split with studied string passed to the regep engine');
}
+
+{
+ $_ = "AABBAABB";
+ study;
+ is(s/AB+/1/ge, 2, 'studied scalar passed to pp_substconst');
+ is($_, 'A1A1');
+}
+
+{
+ $_ = "AABBAABB";
+ study;
+ is(s/(A)B+/1/ge, 2,
+ 'studied scalar passed to pp_substconst with RX_MATCH_COPIED() true');
+ is($1, 'A');
+ is($2, undef);
+ is($_, 'A1A1');
+}