Skip to content

Commit

Permalink
Revert unecessary regex change from e4393ae
Browse files Browse the repository at this point in the history
See #7360 (comment). No regex changes were necessary in the end because we ended up just restricting the overal length
  • Loading branch information
adriangb committed Sep 25, 2023
1 parent 4279fc5 commit e50ca73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pydantic/networks.py
Expand Up @@ -638,7 +638,7 @@ def _build_pretty_email_regex() -> re.Pattern[str]:
name_chars = r'[\w!#$%&\'*+\-/=?^_`{|}~]'
unquoted_name_group = fr'((?:{name_chars}+\s+)*{name_chars}+)'
quoted_name_group = r'"((?:[^"]|\")+)"'
email_group = r'<\s*(.{0,254})\s*>'
email_group = r'<\s*(.+)\s*>'
return re.compile(rf'\s*(?:{unquoted_name_group}|{quoted_name_group})?\s*{email_group}\s*')


Expand Down

0 comments on commit e50ca73

Please sign in to comment.