From: Jarkko Hietaniemi Date: Sat, 12 Jan 2002 04:55:20 +0000 (+0000) Subject: Unicode lookbehind looked bad. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e54858b049d061e51d06b86d1010dc069ad281c1;p=p5sagit%2Fp5-mst-13.2.git Unicode lookbehind looked bad. p4raw-id: //depot/perl@14205 --- diff --git a/regexec.c b/regexec.c index bdd7c0d..0ceff78 100644 --- a/regexec.c +++ b/regexec.c @@ -111,7 +111,7 @@ #define HOPMAYBEc(pos,off) ((char*)HOPMAYBE(pos,off)) #define HOPBACK(pos, off) ( \ - (UTF && PL_reg_match_utf8) \ + (PL_reg_match_utf8) \ ? reghopmaybe((U8*)pos, -off) \ : (pos - off >= PL_bostr) \ ? (U8*)(pos - off) \ diff --git a/t/op/pat.t b/t/op/pat.t index 467e0a2..f7e9a61 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -6,7 +6,7 @@ $| = 1; -print "1..846\n"; +print "1..847\n"; BEGIN { chdir 't' if -d 't'; @@ -2652,3 +2652,10 @@ print "# some Unicode properties\n"; $r2 =~ s/\x{100}//; print $r1 eq $r2 ? "ok 846\n" : "not ok 846\n"; } + +{ + print "# Unicode lookbehind\n"; + + print "A\x{100}B" =~ /(?<=A.)B/ ? "ok 847\n" : "not ok 847\n"; + print "A\x{200}\x{300}B" =~ /(?<=A..)B/ ? "ok 848\n" : "not ok 848\n"; +}