Ejemplo n.º 1
0
    def check_type(txt):
        from core.observables import Hostname
        try:
            localpart, hostname = txt.split("@")
        except Exception:
            return False

        return bool(
            Hostname.check_type(hostname)
            and re.match("^[a-zA-Z0-9!#%&'*+-/=?^_`{|}~]+$", localpart))
Ejemplo n.º 2
0
 def is_valid(cls, match):
     return Hostname.check_type(match.group('domain'))