Validating Email Addresses With a Filter

  • + 0 comments
    import re
    
    def fun(s):
        result = re.fullmatch(r'[a-z0-9_-]+@[a-z0-9]+\.[a-z]{1,3}', s, re.I)
        
        return True if result else False