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?

I am interested in this for the use of regular expressions.  I would like to 
be able to accept re patterns as inputs either from a file or from a GUI 
tool and I would like to allow those inputs as regular strings and not force 
users to write patterns with double escapes.

I naively thought there could be utilities for such a conversion either in 
the string module or the StringIO module but I don't see any utilities like 
that.

So, any suggestions?

Dan 


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to