New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Captures from interpolated variables do not capture #5672
Comments
From @zoffixznet<Zoffix> m: my $m = 'a 123' ~~ /(\d\d\d)/; dd [$m.list]; Expected results: output is the same, as the $input contains a capture that should capture stuff when interpolated. |
From @zoffixznet<ugexe> m: my $input = q|(\d\d\d)|; my $rx = rx/<$input>/; my $m = "a 123 456" ~~ m:g/$rx/; dd [$m.list>>.Str]; |
From @pmichaudOn Wed, Sep 14, 2016 at 05:10:55PM -0700, Zoffix Znet wrote:
<$input> is non-capturing, so even though it contains a $0 capture, its result Rewrite to <input=$input> or $0=<$input> and you'll see the resulting capture. <pmichaud> m: my $input = '(\d\d\d)'; my $m = 'a 123' ~~ /<input=$input>/; say $m As far as I know, there's not a way to have a "top-level" capturing Rejecting ticket as not-a-bug. Pm |
The RT System itself - Status changed from 'new' to 'open' |
@pmichaud - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#129271 (status was 'rejected')
Searchable as RT129271$
The text was updated successfully, but these errors were encountered: