DEV Community

Discussion on: 100 Languages Speedrun: Episode 47: Raku (Perl 6) Regular Expressions

 
taw profile image
Tomasz Wegrzanowski

docs.raku.org/language/regexes thinks "௩.௩.௩.௩" is a valid IP address, and good luck pinging that.

Even people who wrote the page explaining the Raku \d can't actually follow how the broken \d works and assume it works on ASCII only in the rest of the document.

Thread Thread
 
lizmat profile image
Elizabeth Mattijsen

Then the documentation is where the error is.

Thread Thread
 
taw profile image
Tomasz Wegrzanowski

Can you find even a single actual Raku program out there, where \d is used, and it intentionally means <:Nd> and it would break the program if \d was changed to match <[0..9]>?

Unfortunately Github code search can't handle special characters like backslash so it can't search for \d directly, and it confuses Raku with Perl 5 when filtering, but here's a start: https://github.com/search?q=filename%3A%22*.raku%22+language%3ARaku&type=Code

Just clicking randomly I see a lot of \d, and ALL of them assume that \d will be ASCII digits is everywhere. Explicit <[0..9]> are very rare. Anyone wanting <:Nd>? I haven't found a single case yet.

Thread Thread
 
vrurg profile image
Vadim Belman

All I could say about pinging the IP is that your parser is just not able to convert the representation into an unsigned 32 bit integer. But it doesn't mean that no other parser is capable of this. Enough to say that dotted notation is a convention. Network addresses are just numbers in their nature.