Regex Tuesday Challenge - Week Eighteen

This challenge is to check to see whether a string is valid IRC message sent to a user or channel. IRC is sufficiently simple that they can be parsed with regular expressions, and proper parser is not required.

To test a regular expression on the test cases below, type it into the text input. Each test case will be marked as passed or failed respectively - you are aiming to get as many test cases as you can to pass. Note that JavaScript must be enabled for this feature to work. The regex engine used is the JavaScript regex engine; it is similar to PCRE, but with a few differences.

Test cases (0/36)

callum!callum@lynx.io PRIVMSG #chat :Hello!
match

ChanServ!ChanServ@Services. PRIVMSG callum :The message can contain anything except new lines.
match



[a]!abc@test PRIVMSG #chat :Test
match
`|\^!abc@test PRIVMSG #chat :Test
match

[_]!abc@test PRIVMSG #chat :Test
match
a0!abc@test PRIVMSG #chat :Test
match
a234567890123456!callum@lynx.io PRIVMSG #chat :Test
match

callum!call!um@lynx.io PRIVMSG #chat :Test
match

callum!cal@lum@lynx.io PRIVMSG #chat :Test
match

callum!callum@lynx.io PRIVMSG ## :Test
match

callum!callum@lynx.io PRIVMSG #a :Test
match

callum!callum@lynx.io PRIVMSG #()"';:<> :Test
match

callum!callum@lynx.io PRIVMSG #chat ::@*(£&%(*&£'[]
match


callum!callum@lynx.io PRIVMSG [a] :Test
match

callum!callum@lynx.io PRIVMSG `|\^ :Test
match

callum!callum@lynx.io PRIVMSG [_] :Test
match

callum!callum@lynx.io PRIVMSG a0 :Test
match

callum!callum@lynx.io PRIVMSG a234567890123456 :Test
match

callum!callum@lynx.io PRIVMSG #(cm) :Test
match

(cm)!callum@lynx.io PRIVMSG #chat :Hello!
no match

cm!!callum@lynx.io PRIVMSG #chat :Hello!
no match

c@m!callum@lynx.io PRIVMSG #chat :Hello!
no match

c,m!callum@lynx.io PRIVMSG #chat :Hello!
no match

c$m!callum@lynx.io PRIVMSG #chat :Hello!
no match

c.m!callum@lynx.io PRIVMSG #chat :Hello!
no match

c;m!callum@lynx.io PRIVMSG #chat :Hello!
no match

0a!abc@test PRIVMSG #chat :Test
no match

a2345678901234567!callum@lynx.io PRIVMSG #chat :Hello!
no match


callum!callum@lynx.io PRIVMSG #$ :Test
match

callum!callum@lynx.io PRIVMSG #€ :Test
match

callum!callum@lynx.io PRIVMSG cm! :Test
no match

callum!callum@lynx.io PRIVMSG (cm) :Test
no match

callum!callum@lynx.io PRIVMSG c@m :Test
no match

callum!callum@lynx.io PRIVMSG c,m :Test
no match

callum!callum@lynx.io PRIVMSG c$m :Test
no match

callum!callum@lynx.io PRIVMSG c.m :Test
no match
Congratulations, your regex passes all the test cases! Remember to share this challenge.