from string to raw string

Dan Perl danperl at
Tue Dec 14 05:46:45 CET 2004

Yeah, you're right.  I got it all twisted in my mind.  It's late and I must 
be getting tired.



"Brian Beck" <exogen at> wrote in message 
news:cplqc9$4rj$1 at
> Dan Perl wrote:
>> Is there a way to convert a regular string to a raw string so that one 
>> could get from '\bblah' to r'\bblah' other than parsing the string and 
>> modifying the escapes?
> There's no such thing as a raw string, only raw string literals. In other 
> words, it's a syntax to tell the Python interpreter which characters in 
> your string are 'special' and has no effect on strings not input as 
> literals directly within your code.  Strings from files or any input 
> besides the interactive Python shell will already be what you're looking 
> for.
> -- 
> Brian Beck
> Adventurer of the First Order 

More information about the Python-list mailing list