import retest = ['bbb', 'ccc', 'axx', 'xzz', 'xaa']reg = re.compile(r'^x')test = list(filter(reg.search, test))print(test)
Standard input is empty
['xzz', 'xaa']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!