import re print re.findall('[a-z]+\.(?:txt|html)', 'abc.txt def.html')
Standard input is empty
['abc.txt', 'def.html']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!