def emailLeech(text):
    ''' An iterator over recognized email addresses within text'''
    while (True):
        match = EMAIL_REGEX.search(text)
        if not match: break
        parts = [match.group("name")] + \
                DOT_REGEX.split(match.group("site")) + \
                [match.group("domain")]
        # discard non word chars
        parts = [NONWORD.sub('',part) for part in parts]
        # discard all empty parts and make lowercase
        parts = [part.lower() for part in parts if len(part)>0]
        # join the parts
        yield "%s@%s.%s" % (parts[0], '.'.join(parts[1:-1]), parts[-1])
        text = text[match.end():]
 An iterator over recognized email addresses within text
recipes/Python/275366_Email_address_leech/recipe-275366.py