import reword = 'testing: 'word = re.sub(r'[a-zA-Z]+:', r'"\g<0>"',word)print(word)
Standard input is empty
"testing:"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!