Problem with regular expression

Emile van Sebille emile at
Wed Sep 27 15:02:27 CEST 2000

Because the string must first be evaluated before being
passed to re where it will again be evaluated.  Before I saw
Arpad's reply, my first thought was to try



Emile van Sebille
emile at

"Pieter Claerhout" <Pieter_Claerhout at> wrote
in message
news:mailman.970056701.6238.python-list at
> Looks a bit unlogical to me. The rules say that you either
need to escape the backslash or use the raw notation
(according to the docs). Why do I need to both escape the
backslash here and use the raw notation if I want to match a
single backslash??
> Pieter
> -----Original Message-----
> From: Arpad Kiss [mailto:sekter at]
> Sent: Wednesday, September 27, 2000 1:29 PM
> To: python-list at
> Subject: Re: Problem with regular expression
> Hi,
> Try this: p=re.compile(r'[A-Za-z]:\\')
> Arpad

More information about the Python-list mailing list