This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Unicode lookbehind looked bad.
authorJarkko Hietaniemi <jhi@iki.fi>
Sat, 12 Jan 2002 04:55:20 +0000 (04:55 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 12 Jan 2002 04:55:20 +0000 (04:55 +0000)
p4raw-id: //depot/perl@14205

regexec.c
t/op/pat.t

index bdd7c0d..0ceff78 100644 (file)
--- a/regexec.c
+++ b/regexec.c
 #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)              \
index 467e0a2..f7e9a61 100755 (executable)
@@ -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";
+}