import res = 'How are you guys today'print(re.sub(r'(\w+)(\W+)(\w+)', r'\3\2\1', s))
Standard input is empty
are How guys you today
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!