From fd9987eff11dee8a3169ef53e8d76c749c28aab6 Mon Sep 17 00:00:00 2001 From: NatanLucena <44265910+NatanLucena@users.noreply.github.com> Date: Tue, 22 Oct 2019 17:09:13 -0300 Subject: [PATCH] Create CheckEmail.py --- allalgorithms/string/CheckEmail.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 allalgorithms/string/CheckEmail.py 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")