CloudBotLegacy icon indicating copy to clipboard operation
CloudBotLegacy copied to clipboard

Fix username regex in cake plugin

Open prplz opened this issue 10 years ago • 5 comments

On network I frequent, the ` character is common in nicknames and they deserve cake too! Found the regex at http://stackoverflow.com/questions/5163255/regular-expression-to-match-irc-nickname . The reason it has two groups of characters is that nicknames can't start with numbers.

prplz avatar May 31 '14 11:05 prplz

I suggest this instead:

[a-z\d_\-\[\]^\\{}|`]{1,32}

http://regex101.com/r/bD3eS9

Zarthus avatar May 31 '14 11:05 Zarthus

Lets just go with checking for spaces, it doesn't really matter if it's a valid IRC nick. This is copied from how attacks.py validates.

prplz avatar May 31 '14 11:05 prplz

And why do we need to block spaces again?

-- Above message was sent from my mobile phone. There may and will be all kinds of errors included. For free! On 31 May 2014 13:25, "prplz" [email protected] wrote:

Lets just go with checking for spaces, it doesn't really matter if it's a valid IRC nick. This is copied from how attacks.py validates.

— Reply to this email directly or view it on GitHub https://github.com/ClouDev/CloudBot/pull/287#issuecomment-44745746.

literalplus avatar May 31 '14 12:05 literalplus

Its not about that, its about it blocking valid irc nicks for example with the ` character

prplz avatar May 31 '14 13:05 prplz

I know what this PR is about, was just asking a general question.

-- Above message was sent from my mobile phone. There may and will be all kinds of errors included. For free! On 31 May 2014 15:19, "prplz" [email protected] wrote:

Its not about that, its about it blocking valid irc nicks for example with the ` character

— Reply to this email directly or view it on GitHub https://github.com/ClouDev/CloudBot/pull/287#issuecomment-44748140.

literalplus avatar May 31 '14 13:05 literalplus