Subject: | interpolation of re2-regex into re2-regex is broken |
First of all, I wanna thank you for mentioning your module in
discussion if bug 76546!
$ perl -e 'use re::engine::RE2;
$a1 = qr/a/;
$a2 = "(?-im:a)";
$b1 = qr/b$a1/;
$b2 = qr/b$a2/;
printf "a1=%d b1=%d b2=%d <$a1> <$a2>\n",
map {$_->isa("re::engine::RE2")} $a1,$b1,$b2
'
a1=1 b1=0 b2=1 <(?-ixm:a)> <(?-im:a)>
Looks like re2 regex created with qr// contain /x flag, unsupported by
re2. Because of mentioning this flag (even in disabled state) another
regex fall back to standard perl engine.
I think two solutions possible:
1) Doesn't set /x flag in RE2's qr// - if user enabled re2 in this
scope, he shouldn't expect to get from qr// re2-incompatible regexps.
2) When deciding to fall back to perl regexp doesn't take in account
_disabled_ /x flag.