Regular exprssion for IRC messages

Jon Clements joncle at googlemail.com
Wed Jul 22 10:21:49 CEST 2009


On 22 July, 06:43, "Gabriel Genellina" <gagsl-... at yahoo.com.ar> wrote:
> En Fri, 17 Jul 2009 13:59:47 -0300, nohics nohics <noh... 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

Alternatively, if IIRC, the twisted framework has an IRC client, which
automatically parses server messages.



More information about the Python-list mailing list