Skip to content

Instantly share code, notes, and snippets.

View kupp1's full-sized avatar
🎓
ITMO

Dmitrii Kupershtein kupp1

🎓
ITMO
View GitHub Profile
@kupp1
kupp1 / ircparse.coffee
Last active August 15, 2018 18:32
A regular expression that parses RFC2812 (IRC protocol)
# original work by Michael F. Lamb. License: GPLv3.
# added optional tilde before !user by kupp
RFC2812Matcher = ///
^ # We'll match the whole line. Start.
# Optional prefix and the space that separates it
# from the next thing. Prefix can be a servername,
# or nick[[!user]@host]
(?::( # This whole set is optional but if it's
# here it begins with : and ends with space