We start with some IRC related regular expressions, used to match Irc::User nicks and users and Irc::Channel names
For each of them we define two versions of the regular expression:
a generic one, which should match for any server but may turn out to match more than a specific server would accept
an RFC-compliant matcher
Things such has the BIP proxy send invalid nicks in a complete netmask, so we want to match this, rather: this matches either a compliant nick or a a string with a very generic nick, a very generic hostname after an @ sign, and an optional user after a !
Channel-name-matching regexps
Match a list of channel anmes separated by optional commas, whitespace and optionally the word "and"
Sadly, different networks have different, RFC-breaking ways of cloaking the actualy host address: see above for an example to handle FreeNode. Another example would be Azzurra, wich also inserts a "=" in the cloacked host. So let's just not care about this and go with the simplest thing:
User-matching Regexp
Host-matching regexps
Match "in channel" or "on channel" and/or "in private" (optionally shortened to "in pvt"), returning the channel name or the word 'private' or 'pvt' as capture
As above, but with channel lists
Match a list of nicknames separated by optional commas, whitespace and optionally the word "and"
Nick-matching regexps
Generated with the Darkfish Rdoc Generator 2.