Skip Menu |
Report information
Id: 130127
Status: resolved
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: alex.jakimenko [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: regex
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [REGEX] Excluded endpoints in ranged quantifiers do not work at all (/ .**{2^..^2} /)
From: Aleks-Daniel Jakimenko-Aleksejev <alex.jakimenko [...] gmail.com>
Date: Fri, 18 Nov 2016 00:32:08 +0200
To: rakudobug [...] perl.org
Download (untitled) / with headers
text/plain 213b
Code:
say ‘abcefghij’ ~~ / .**{0..^2} /

Result:
「ab」

I expected 「a」


Code:
say ‘abcefghij’ ~~ / .**{2^..^2} /

Result:
「ab」

I expected it not to match anything (as if it was 3..1).
Download (untitled) / with headers
text/plain 251b
10:30 Zoffix teatime: I see another bug with it: 10:31 m: say "xxxxx" ~~ /"x" ** { -5..-1 }/ 10:31 camelia rakudo-moar 8cf083: OUTPUT: «「xxxxx」␤» 10:31 Zoffix It doesn't check whether -1 was its own doing or something that came from the Range
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 484b
On Thu, 17 Nov 2016 14:32:19 -0800, alex.jakimenko@gmail.com wrote: Show quoted text
> *Code:* > say ‘abcefghij’ ~~ / .**{0..^2} / > > *Result:* > 「ab」 > > I expected 「a」 > > > *Code:* > say ‘abcefghij’ ~~ / .**{2^..^2} / > > *Result:* > 「ab」 > > I expected it not to match anything (as if it was 3..1).
Thank you for the report. This is now fixed. Fix: https://github.com/rakudo/rakudo/commit/681d6be9742e7c0 Test: https://github.com/perl6/roast/commit/99c822abdeefbbaf0


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org