Regular Expression for pattern substitution

Vibha Tripathi vibtrip at
Fri Jul 1 18:39:33 CEST 2005

It'd be silly to write the code for it if it already
exists somewhere in the Python re or sre library

I need to find and replace all strings in a text file
from a certain pattern to another pattern.

so for example if I see 'this(\D*)that' anywhere in
the file then I'd like to make is 'that(\D*)this'
where the middle part of the strings remains

Any suggestions?


PS. How do I avoid getting my email ID web-published
for this mailing list.?

Yahoo! Sports 
Rekindle the Rivalries. Sign up for Fantasy Football

More information about the Python-list mailing list