import reold = 'regexregex'new = re.sub(r'regex(group|)regex', r'something\1something', old)print(new)
Standard input is empty
somethingsomething
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!