p = SvPV(pat, plen);
pm->op_pmflags |= PMf_SKIPWHITE;
}
- if (DO_UTF8(pat) || (PL_hints & HINT_UTF8))
+ if (DO_UTF8(pat))
pm->op_pmdynflags |= PMdf_UTF8;
PM_SETRE(pm, CALLREGCOMP(aTHX_ p, p + plen, pm));
if (strEQ("\\s+", PM_GETRE(pm)->precomp))
op_free(expr);
}
else {
- if (PL_hints & HINT_UTF8)
- pm->op_pmdynflags |= PMdf_UTF8;
if (pm->op_pmflags & PMf_KEEP || !(PL_hints & HINT_RE_EVAL))
expr = newUNOP((!(PL_hints & HINT_RE_EVAL)
? OP_REGCRESET
}
require './test.pl';
-plan( tests => 87 );
+plan( tests => 88 );
$x = 'foo';
$_ = "x";
$_ = "Charles Bronson";
$snum = s/\B\w//g;
ok( $_ eq "C B" && $snum == 12 );
+
+{
+ use utf8;
+ my $s = "H\303\266he";
+ my $l = my $r = $s;
+ $l =~ s/[^\w]//g;
+ $r =~ s/[^\w\.]//g;
+ is($l, $r, "use utf8");
+}