import rep = re.compile(r'(?=(a{2}))')test_str = "aaab"print(re.findall(p, test_str))
Standard input is empty
['aa', 'aa']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!