From: David A. <da...@bo...> - 2003-03-17 12:01:14
|
eng...@ss... writes: > you were a little greedy, this one:: > > text = re.sub(r'[^{][\\]', r'{\textbackslash}', text) > > will replace any the backslash AND the preceeding character (except for a > brace). Oops. > AND there need to be two backslashes. I'm pretty sure that's wrong: note that they're raw strings. Did you test the result? -- Dave Abrahams Boost Consulting www.boost-consulting.com |