re.sub() backreference bug?

Tim Chase python.list at tim.thechases.com
Thu Aug 17 19:25:34 EDT 2006


> Tim's given you the solution to the problem: with the re module,
> *always* use raw strings  in regexes and substitution strings.


"always" is so...um...carved in stone.  One can forego using raw 
strings if one prefers having one's strings looked like they were 
trampled by a stampede of creatures with backslash-shaped hooves...

uh...yeah...stick with raw strings. :)

-tkc






More information about the Python-list mailing list