File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -85,11 +85,15 @@ def email(
85
85
)
86
86
if re .match (
87
87
# extended latin
88
- r"(^[\u0100-\u017F\u0180-\u024F]"
88
+ r"(^[\u0100-\u017F\u0180-\u024F\u00A0-\u00FF ]"
89
89
# dot-atom
90
- + r"|[-!#$%&'*+/=?^_`{}|~0-9a-z]+(\.[-!#$%&'*+/=?^_`{}|~0-9a-z]+)*$"
90
+ + r"|[\u0100-\u017F\u0180-\u024F\u00A0-\u00FF0-9a-z!#$%&'*+/=?^_`{}|~\-]+"
91
+ + r"(\.[\u0100-\u017F\u0180-\u024F\u00A0-\u00FF0-9a-z!#$%&'*+/=?^_`{}|~\-]+)*$"
91
92
# quoted-string
92
- + r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\011.])*"$)' ,
93
+ + r'|^"('
94
+ + r"[\u0100-\u017F\u0180-\u024F\u00A0-\u00FF\001-\010\013\014\016-\037"
95
+ + r"!#-\[\]-\177]|\\[\011.]"
96
+ + r')*")$' ,
93
97
username_part ,
94
98
re .IGNORECASE ,
95
99
)
Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ def test_returns_true_on_valid_email(value: str):
48
48
('"test@test"@example.com' ,),
49
49
# Quoted-string format (CR not allowed)
50
50
('"\\ \012 "@here.com' ,),
51
+ # Non-quoted space/semicolon not allowed
52
+ ("stephen smith@example.com" ,),
53
+ ("stephen;smith@example.com" ,),
51
54
],
52
55
)
53
56
def test_returns_failed_validation_on_invalid_email (value : str ):
You can’t perform that action at this time.
0 commit comments