python raw strings?

Cy Edmunds cedmunds at spamless.rochester.rr.com
Tue Aug 24 22:30:43 EDT 2004


"Maurice LING" <mauriceling at acm.org> wrote in message
news:412bc766$1 at news.unimelb.edu.au...
> I'm trying to toy around with PLY (python lex-yacc) by David Beazley
> from University of Chicago and realized that the lex module uses python
> raw strings. What are python raw strings and how are they different from
> regular strings? I've tried to look up in the python documentation but
> it just vaguely brushes through by saying that python raw strings are
> prefixed with "r" or "R".
>
> In PLY, "+" is "r'\+'" but "-" is "r'-'", why is there an extra "\" in
> "+"? When to use the extra "\" and when not?
>
> Can someone point me in the correct direction?
>
> Thanks
> Maurice

http://docs.python.org/lib/module-re.html

-- 
Cy
http://home.rochester.rr.com/cyhome/





More information about the Python-list mailing list