summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--regexec.c2
-rwxr-xr-xt/op/pat.t9
2 files changed, 9 insertions, 2 deletions
diff --git a/regexec.c b/regexec.c
index bdd7c0db8f..0ceff78a7f 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 467e0a29d0..f7e9a61590 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";
+}