# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #65236] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=65236 >
* moritz_ slaps forehead <moritz_> I know what's wrong <moritz_> .chunks thinks that .from and .to are zero-based <moritz_> but of course they are based on self.from <moritz_> rakudo: ' foo' ~~ /.*?f(.(.)+)/; say $0.chunks.perl <p6eval> rakudo c76d8d: OUTPUT«["~" => "oo", 0 => Match.new( # WARNING: this is not working perl code # and for debugging purposes only ast => "o", text => "o", from => 5, to => 6,)]» <moritz_> see, it produces three 'o's altogether <moritz_> although all o's should add up to 2 <moritz_> rakudo: ' foo' ~~ /.*?f(.(.))/; say $0.chunks.perl <p6eval> rakudo c76d8d: OUTPUT«["~" => "oo", 0 => Match.new( # WARNING: this is not working perl code # and for debugging purposes only ast => "o", text => "o", from => 5, to => 6,)]» <masak> is it a bug? :) <moritz_> sure * masak submits rakudobug So, the bug is that there are three "o" captured in that match tree, whereas S05:2587 promises that "In the absence of [weirdness], C<.chunks> guarantees to map every part of its matched string (between C<.from> and C<.to>) to exactly one element of its returned matches"