import remyString = "123ABC,'2009-12-23T23:45:58.544-04:00'"rx = r'(?<=\d)T(?=\d)' new_string = re.sub(rx, ' ', myString)print new_string
Standard input is empty
123ABC,'2009-12-23 23:45:58.544-04:00'
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!