I'm making a irc lib and I can't seem to match just private messages, it also matches the version string.
REGEX
:(?P<from>.*?)!\S+\sPRIVMSG\s(?P<to>.*?)\s:(?P<msg>.+)
VERSION MATCH
VERSION_STRING: :AkaneSenri1!~AkaneSenr@72A6C9FC.264941B0.A6596FAF.IP PRIVMSG AkaneSenri1 :VERSION
MATCHED: AkaneSenri1', u'AkaneSenri1', u'\x01VERSION\x01
PRIVATE_MESSAGE_STRING: :AkaneSenri1!~AkaneSenr@72A6C9FC.264941B0.A6596FAF.IP PRIVMSG AkaneSenri1 :T
MATCHED: (u'AkaneSenri1', u'AkaneSenri1', u'T') # is what I want
What I'm getting is the version string that that the server sends when you connect. What I need is, when a user sends the bot a PM. (nick/msg)