Search List for Pattern

PHOTO EMBED

Mon Jul 04 2022 09:54:47 GMT+0000 (Coordinated Universal Time)

Saved by @larksa #pytho #list

import re

r = re.compile(".*xlsx")                             ## what searching for
new_list = list(filter(r.match, list-name))			## list-name is the list
print(new_list)
content_copyCOPY