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?

Assuming you might mean something else, that something else might be:

   s = r'no_tab_\t_here'
   len(s.split()) == 1
   len(s.decode('string_escape').split()) == 2
   s = 'tab_\t_here'
   len(s.split()) == 2
   len(s.encode('string_escape').split()) == 1

-Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to