For email validation, i have following conditions: 1. username should be alphanumeric only(a-z,0-9,A-Z) 2. website name should be a-z 3. extension should be a-z
i am writing a python code as :
import re
def check(email):
#complete the function
#the function should return the strings "invalid" or "valid" based on the email ID entered
if(re.search('^[a-zA-Z0-9]+$@^[a-z]+$.^[a-z]+$',email)):
return("valid")
else:
return("invalid")
email=input()
print(check(email))
My input: vk@google.com But it returns me "Invalid" It should return as "Valid". What am i doing wrong here?