import rep = re.compile(r'(?i)(some)string')test_str = "somestring"print([(x.group(0),x.group(1)) for x in p.finditer(test_str)])
Standard input is empty
[('somestring', 'some')]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!