How do you best go about translating characters like '\\n' to '\n'?
This is for a configuration file parser, where the "backslash
convention" is supported.
The naive approach -- re.sub('\\\\(.)', '\\\1', s) -- doesn't work, of
course. The best I've come up with so far is a special case for every
character to be translated. There must be an easier way?
--
Henrik S. Hansen http://freecode.dk/~hsh/
Computer science (software engineering) student
Free Software Foundation member #1702 (http://member.fsf.org)