Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions Address Validator/AddressValidator.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
def addressVal(address):
dot = address.find(".")
at = address.find("@")
if (dot == -1):
print("Invalid")
elif (at == -1):
print("Invalid")
else:
print("Valid")
import re

print("This program will decide if your input is a valid email address")
while(True):
print("A valid email address needs an '@' symbol and a '.'")
x = input("Input your email address:")
print("A valid email address must be in the format [email protected].")
x = input("Input your email address: ")

addressVal(x)
result = re.fullmatch(r'^\S+@\S+\.\S+', x)

if result:
break