import re pattern = r"\w*([a-zA-Z])\1\w*"s = 'settle, look, test'for m in re.finditer(pattern, s): print(m.group())
Standard input is empty
settle look
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!