So I try to print only the month, and when I use :
regex = r'([a-z]+) \d+'
re.findall(regex, 'june 15')
And it prints : june But when I try to do the same for a list like this :
regex = re.compile(r'([a-z]+) \d+')
l = ['june 15', 'march 10', 'july 4']
filter(regex.findall, l)
it prints the same list like they didn't take in count the fact that I don't want the number.