== (SVs_OBJECT|SVs_RMG))
&& strEQ(s=HvNAME(SvSTASH(sv)), "Regexp")
&& (mg = mg_find(sv, 'r'))) {
- regexp *re = (regexp *)mg->mg_obj;
-
- *lp = re->prelen;
- return re->precomp;
+ if (!mg->mg_ptr) {
+ regexp *re = (regexp *)mg->mg_obj;
+
+ mg->mg_len = re->prelen + 4;
+ New(616, mg->mg_ptr, mg->mg_len + 1, char);
+ Copy("(?:", mg->mg_ptr, 3, char);
+ Copy(re->precomp, mg->mg_ptr+3, re->prelen, char);
+ mg->mg_ptr[mg->mg_len - 1] = ')';
+ mg->mg_ptr[mg->mg_len] = 0;
+ }
+ *lp = mg->mg_len;
+ return mg->mg_ptr;
}
/* Fall through */
case SVt_NULL:
$test++;
# This should be changed to qr/\b\v$/ ASAP
-print "not " unless study(/\b\v$/) eq '\bv$';
+print "not " unless study(/\b\v$/) eq '(?:\bv$)';
print "ok $test\n";
$test++;