Regex import re pattern = re.compile("\w.?\w+@\w[.\w+]") finds subpatterns good_email = filter(lambda x: pattern.search(x), emails) needs to match re completely good_email = filter(lambda x: pattern.match(x), emails)