Raku / whateverable

🤖 Different IRC bots that operate on a bunch of prebuilt Rakudo versions
https://gist.github.com/Whateverable
GNU Affero General Public License v3.0
18 stars 14 forks source link

nick recognition and normalization is wrong #375

Closed treyharris closed 4 years ago

treyharris commented 4 years ago

Looking at normalize-weirdly: underscores are valid nick characters, so I think this may cause bad behavior for users with underscore-containing nicks? The comments mention that the substitutions are based on actual failed messages, but I think perhaps the diagnostic of underscores is wrong? (Also, many IRC clients deal with a nick being already taken by prepending or appending underscore(s), so perhaps that’s where you saw nicks with underscores being “wrong”?)

A valid PCRE for valid nicks not including Unicode extensions is:

/\A[a-z_\-\[\]\\^{}|`][a-z0-9_\-\[\]\\^{}|`]*\z/i

And the Unicode extensions (which should be pretty easy to add in Raku) are shown here.

AlexDaniel commented 4 years ago

Answered here: https://github.com/Raku/whateverable/issues/374#issuecomment-579366393 TL;DR it's meant to be that way and there's no need to change it unless we stumble upon a real life issue.