From 63db1c8f35a9b6ab1bd45c0c5b9657afbb95312f Mon Sep 17 00:00:00 2001 From: Erhan Sahin Date: Mon, 8 Jan 2018 13:36:05 +0100 Subject: [PATCH 1/4] Add new gTLD support. --- lib/regexes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/regexes.py b/lib/regexes.py index 3c4ecab..995fe0f 100644 --- a/lib/regexes.py +++ b/lib/regexes.py @@ -1,7 +1,7 @@ import re regexes = { - 'email': re.compile(r'[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}', re.I), + 'email': re.compile(r'[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,5}', re.I), #'ssn' : re.compile(r'\d{3}-?\d{2}-?\d{4}'), 'hash32': re.compile(r'[^ Date: Fri, 23 Feb 2018 11:49:26 +0100 Subject: [PATCH 2/4] Changed the email regex to one from emailregex.com --- lib/regexes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/regexes.py b/lib/regexes.py index 995fe0f..7121cf6 100644 --- a/lib/regexes.py +++ b/lib/regexes.py @@ -1,7 +1,7 @@ import re regexes = { - 'email': re.compile(r'[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,5}', re.I), + 'email': re.compile(r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)", re.I), #'ssn' : re.compile(r'\d{3}-?\d{2}-?\d{4}'), 'hash32': re.compile(r'[^ Date: Mon, 26 Feb 2018 11:07:50 +0100 Subject: [PATCH 3/4] Removed case sensitive stuff as flag is already set and not sure if TLD can have numbers. --- lib/regexes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/regexes.py b/lib/regexes.py index 7121cf6..3109f43 100644 --- a/lib/regexes.py +++ b/lib/regexes.py @@ -1,7 +1,7 @@ import re regexes = { - 'email': re.compile(r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)", re.I), + 'email': re.compile(r"([a-z0-9_.+-]+@[a-z0-9-.]+\.[a-z]+$)", re.I), #'ssn' : re.compile(r'\d{3}-?\d{2}-?\d{4}'), 'hash32': re.compile(r'[^ Date: Mon, 26 Feb 2018 11:11:42 +0100 Subject: [PATCH 4/4] Changing the quantifier from {2,4} to + --- lib/regexes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/regexes.py b/lib/regexes.py index 3109f43..f80e223 100644 --- a/lib/regexes.py +++ b/lib/regexes.py @@ -1,7 +1,7 @@ import re regexes = { - 'email': re.compile(r"([a-z0-9_.+-]+@[a-z0-9-.]+\.[a-z]+$)", re.I), + 'email': re.compile(r'[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]+', re.I), #'ssn' : re.compile(r'\d{3}-?\d{2}-?\d{4}'), 'hash32': re.compile(r'[^