sorear/niecza

Capturing parens aren't recognized as capturing inside strings interpolated into regexes

Closed this issue · 0 comments

<sorear> niecza: my $hello = "'/'hello'/'(<-[\\\\/\\\\.]>+)"; my $reg  = / ^ <hello=$hello> $/; "/hello/bug" ~~ $reg; say $/<hello>[0];
<p6eval> niecza v13-1-gbfba5a3: OUTPUT«Any()␤»
<sorear> niecza: my $hello = "'/'hello'/'(<-[\\\\/\\\\.]>+)"; my $reg  = / ^ <hello=$hello> $/; "/hello/bug" ~~ $reg; say $/;
<p6eval> niecza v13-1-gbfba5a3: OUTPUT«#<match from(0) to(10) text(/hello/bug) pos([].list) named({"hello" => #<match 
                from(0) to(10) text(/hello/bug) pos([].list) named({}.hash)>}.hash)>␤»
<sorear> niecza: my $hello = "'/'hello'/'(<-[\\\\/\\\\.]>+)"; my $reg  = / ^ <hello=$hello> $/; "/hello/bug" ~~ $reg; say $/<hello>;
<p6eval> niecza v13-1-gbfba5a3: OUTPUT«#<match from(0) to(10) text(/hello/bug) pos([].list) named({}.hash)>␤»
<sorear> oh
<sorear> it's not being recognized as a capturing operator :|
* masak submits nieczabug

The expectation being, of course, that there be a $/[0] with a match capturing "bug" in it.