Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python projects

# How To Validate An Email Address In Python
# Using "re" package
import re   
  
regex = '^[a-z0-9]+[._]?[a-z0-9]+[@]w+[.]w{2,3}$'  
  
def check(email):   
  
    if(re.search(regex,email)):   
        print("Valid Email")   
    else:   
        print("Invalid Email")   
      
if __name__ == '__main__' :   
      
    email = "rohit.gupta@mcnsolutions.net"  
    check(email)   
  
    email = "praveen@c-sharpcorner.com"  
    check(email)   
  
    email = "inform2atul@gmail.com"  
    check(email)
Source by www.kdnuggets.com #
 
PREVIOUS NEXT
Tagged: #python #projects
ADD COMMENT
Topic
Name
6+1 =