import rep = re.compile(r'[abcgr]([a-z])\1[ldc]')s = "reel reed have that with this they"print([x.group(0) for x in p.finditer(s)])
Standard input is empty
['reel', 'reed']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!