Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4f8170d

Browse files
Create email_validator.py
1 parent cd778bb commit 4f8170d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎email_validator.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import re
2+
3+
# Email is valid based on the following:
4+
# 1. 1 to 20 lowercase and uppercase letters, numbers plus ._%+-
5+
# 2. An @ symbol
6+
# 3. 2 to 20 lowercase and uppercase letters, numbers, plus .-
7+
# 4. A period
8+
# 5. 2 to 3 lowercase and uppercase letters
9+
10+
email_list = "db@aol.com m@.com @apple.com db@.com"
11+
print("Email Matches:", len(re.findall("[\w._%+-]{1,20}@[\w.-]{2,20}.[A-Za-z]{2,3}", email_list)))

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /