File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 88
99### Changed
1010
11- - Improve e-mail regex
11+ - Improve regex to detect e-mails
1212
1313## Version 0.5.1 (2022-11-11)
1414
Original file line number Diff line number Diff line change 106106# note: this is not a valid e-mail regex; it is very permissive to detect
107107# only scripts that have no e-mail, even in an obfuscated form
108108EMAIL_REGEX = re .compile (
109- # valid email with extra chars allowed (like # and * for obfuscation)
110- r"([*#a-z0-9_.+-]+ ?(@|[\[({ ] *at[\])} ] *) ?[*#a-z0-9-]+(\.| *dot *)[a-z0-9-.]+)|"
109+ # valid email with extra chars allowed (like # and * for obfuscation), eg:
110+ 111+ # some.name AT domain.org
112+ # some.name [at] domain [dot] org
113+ r"("
114+ r"[*#a-z0-9_.+-]+ ?" # some.name
115+ r"(@|[\[({ ] *at[\])} ] *) ?" # "@", "[at]", " AT "
116+ r"[*#a-z0-9-]+ ?" # domain
117+ r"(\.|[\[({ ] *dot[\])} ] *) ?" # ".", "[dot]", " DOT "
118+ r"[a-z0-9-.]+)" # org
119+ r"|"
111120 # <some.email>
112121 r"(<[a-z0-9_.+-]+>)" ,
113122 flags = re .IGNORECASE ,
You can’t perform that action at this time.
0 commit comments