📅  最后修改于: 2022-03-11 14:46:53.131000             🧑  作者: Mango
import re
list_of_files = ["file1","file100","file4","file7"]
def extract_number(f):
s = re.findall("\d+$",f)
return (int(s[0]) if s else -1,f)
print(max(list_of_files,key=extract_number))