diff --git a/allalgorithms/string/CheckEmail.py b/allalgorithms/string/CheckEmail.py new file mode 100644 index 0000000..ce629a8 --- /dev/null +++ b/allalgorithms/string/CheckEmail.py @@ -0,0 +1,20 @@ +# -*- coding: UTF-8 -*- +# +# Check email +# The All â–²lgorithms library for python +# +# Contributed by: Natan Lucena +# Github: @NatanLucena +# + +import re + +regex = '^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$' + +def check(email): + + if(re.search(regex,email)): + print("Valid Email") + + else: + print("Invalid Email")