what is wrong with that r"\"

Neil Cerutti horpner at yahoo.com
Wed Jul 4 18:28:43 CEST 2007


On 2007-07-04, Marc 'BlackJack' Rintsch <bj_666 at gmx.net> wrote:
> On Wed, 04 Jul 2007 11:21:14 +0000, Neil Cerutti wrote:
>
>> If the escaped quotes didn't function in raw strings, I'd be
>> unable to construct (with a single notation) a regex that
>> included both kinds of quotes at once.
>> 
>>   re.compile(r"'\"")
>
> Where's the problem!? ::
>
>   re.compile(r''''"''')

That incurs the problem that you can't end with a '. So you can't
end with *something* either way.

-- 
Neil Cerutti



More information about the Python-list mailing list