Regular exprssion for IRC messages

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Wed Jul 22 01:43:07 EDT 2009


En Fri, 17 Jul 2009 13:59:47 -0300, nohics nohics <nohics at gmail.com>  
escribió:

> When an IRC client receive a messages, this message in in a special  
> format
> defined here: Message format in pseudo
> BNF<http://www.irchelp.org/irchelp/rfc/chapter2.html#c2_3_1>(
>
> I want to transforme the message format defined in the irc protocole in  
> the
> last link, to a regular expression to get the nickname, the username, the
> host, the commad, it's arguments if exist, and the message after ":"

You may want to use the pyparsing module instead of a monstruous and  
unmantainable regular expression:

http://pyparsing.wikispaces.com/

-- 
Gabriel Genellina




More information about the Python-list mailing list