Last active
June 25, 2022 07:42
-
-
Save DanielOaks/ef8b21a25a4db5899015 to your computer and use it in GitHub Desktop.
IRC Message Splitting Regex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Page explaining this regex: http://danieloaks.net/irc-regex/ | |
Raw regex: | |
^(?:@([^\r\n ]*) +|())(?::([^\r\n ]+) +|())([^\r\n ]+)(?: +([^:\r\n ]+[^\r\n ]*(?: +[^:\r\n ]+[^\r\n ]*)*)|())?(?: +:([^\r\n]*)| +())?[\r\n]*$ | |
Sample IRC messages: | |
foo bar baz asdf | |
:coolguy foo bar baz asdf | |
foo bar baz :asdf quux | |
foo bar baz : | |
foo bar baz ::asdf | |
:coolguy foo bar baz :asdf quux | |
:coolguy foo bar baz : asdf quux | |
:coolguy PRIVMSG bar :lol :) | |
:coolguy foo bar baz : | |
:coolguy foo bar baz : | |
@a=b;c=32;k;rt=ql7 foo | |
@a=b\\\\and\\nk;c=72\\s45;d=gh\\:764 foo | |
@c;h=;a=b :quux ab test cd | |
:src JOIN #chan | |
:src JOIN :#chan | |
:src AWAY | |
:src AWAY | |
:cool guy foo bar baz | |
:gravel.mozilla.org 432 #momo :Erroneous Nickname: Illegal characters | |
:gravel.mozilla.org MODE #tckk +n | |
:services.esper.net MODE #foo-bar +o foobar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment