使用map而不是filter像这个例子:import rea = ['june 15', 'march 10', 'july 4']regex = re.compile(r'([a-z]+) \d+')# Or with a list comprehension# output = [regex.findall(k) for k in a]output = list(map(lambda x: regex.findall(x), a))print(output)输出:[['june'], ['march'], ['july']]奖金:为了展平列表列表,您可以执行以下操作:output = [elm for k in a for elm in regex.findall(k)]# Or:# output = list(elm for k in map(lambda x: regex.findall(x), a) for elm in k)print(output)输出:['june', 'march', 'july']