Hackerss.com

Hackerss.com is a community of amazing hackers

Hackerss is a community for developers, data scientitst, ethical hackers, hardware enthusiasts or any person that want to learn / share their knowledge of any aspect of digital technology.

Create account Log in
hackerss
hackerss

Posted on

Python Validar si un string con correo es correcto


import re

def validar_correo(correo):
    if re.match('^[(a-z0-9\_\-\.)][email protected][(a-z0-9\_\-\.)]+\.[(a-z)]{2,15}$',correo.lower()):
        return True
    else:
        return False

correo = input("Ingrese correo: ")

if validar_correo(correo):
    print("Correo correcto")
else:
    print("Correo incorrecto")
Enter fullscreen mode Exit fullscreen mode

Top comments (0)