Hi,

I recently asked the same question, the response I got was that just use the string. There is no raw string object so the conversion doesn't exist. As far as I know, I haven't run into any problem

Take a try. Please let me know if there is any problem with this approach.


Good luck



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?

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