Message-Id: <
199806210827.EAA26322@monk.mps.ohio-state.edu>
p4raw-id: //depot/perl@1185
}
}
REGCP_SET;
- if (regmatch(prog->program + 1) && reginput >= regtill) {
+ if (regmatch(prog->program + 1)) {
prog->startp[0] = startpos;
prog->endp[0] = reginput;
return 1;
}
sayNO;
break;
- case SUCCEED:
case END:
+ if (locinput < regtill)
+ sayNO; /* Cannot match: too short. */
+ /* Fall through */
+ case SUCCEED:
reginput = locinput; /* put where regtry can find it */
sayYES; /* Success! */
case SUSPEND:
# $RCSfile: pat.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:12 $
-print "1..108\n";
+print "1..113\n";
$x = "abc\ndef\n";
print "ok $test\n";
$test++;
+$_ = 'xabcx';
+foreach $ans ('', 'c') {
+ /(?<=(?=a)..)((?=c)|.)/g;
+ print "not " unless $1 eq $ans;
+ print "ok $test\n";
+ $test++;
+}
+
+$_ = 'a';
+foreach $ans ('', 'a', '') {
+ /^|a|$/g;
+ print "not " unless $& eq $ans;
+ print "ok $test\n";
+ $test++;
+}
+
sub must_warn_pat {
my $warn_pat = shift;
return sub { print "not " unless $_[0] =~ /$warn_pat/ }