Skip Menu |
Report information
Id: 130508
Status: new
Priority: 0/
Queue: perl6

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

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



Subject: [@LARRY] Backslashed digits in character classes are inconsistent (/ <[\5]> /)
Download (untitled) / with headers
text/plain 815b
First, two examples: Code: say “5” ~~ /<[\5]>/ Result: 「5」 Code: say “0” ~~ /<[\0]>/ Result: Nil Why? Because backslashed zero stands for a null byte: Code: say “\0” ~~ /<[\0]>/ Result: 「␀」 The fact that some backslashed digits do one thing and others do something else is inconsistent by itself. However, we might also look at the behavior elsewhere: Code: say “2” ~~ / \2 / Result: ===SORRY!=== Error while compiling -e Unrecognized backslash sequence (did you mean $1?) at -e:1 ------> say “2” ~~ / \2⏏ / Code: say “2” eq “\2” Result: ===SORRY!=== Error while compiling -e Unrecognized backslash sequence (did you mean $1?) at -e:1 ------> say “2” eq “\2⏏” If we cannot recognize this backslash sequence, let's not recognize it everywhere?


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