modern-irc
modern-irc copied to clipboard
Wildcard grammar does not allow masks like "`*ar`"
The ABNF for wildcard expressions currently requires that all occurrences of * or ? be preceded by a non-backslash character; as a result, the grammar disallows masks that begin with a wildcard that is not followed by another wildcard, such as "*ar" or "?oo". I suspect this is not the intention, and I doubt that many servers implement wildcards as written. A better grammar would be something like:
mask = *( nowildnoesc / wildone / wildmany / esc wildone / esc wildmany / esc esc )
wildone = %x3F
wildmany = %x2A
nowildnoesc = %x01-29 / %x2B-3E / %x40-%5B / %5D-FF
; any octet except NUL, "*", "?", "\"
noesc = %x01-5B / %x5D-FF
; any octet except NUL and "\"
esc = %5C
This also fixes the problem that an escape character can't be escaped.
Do any servers actually implement escapes? We don't.