regular expression conundrum

Chris Spencer clspence at one.net
Wed Aug 14 19:15:08 CEST 2002


Okay, so I have this string: d:\foo\bar\\

I've been trying to find a way of detecting single backslash characters and
properly escaping them, WITHOUT affecting properly escaped backslashes.

So the end result string is: d:\\foo\\bar\\

Does anyone have ANY idea how to accomplish this in Python?  Doesn't have to be
a regular expression.

Any help would be appreciated.

Chris.




More information about the Python-list mailing list