Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the regex used for NameEmail validation #6125

Merged
merged 1 commit into from Jun 14, 2023
Merged

Conversation

dmontagu
Copy link
Contributor

@dmontagu dmontagu commented Jun 13, 2023

Closes #2955

While I agree it would be better to move the logic to rust as suggested in #2955 (comment), in the interest of fixing this for users, I would suggest we just make this change now.

Happy to add more test cases, special callout to @henrybetts for doing the research and putting together an improved regex ages ago. I took an approach inspired by #2955 (comment), and just cleaned up the regex a bit (and used a function to build it to get a bit better implicit documentation), and the tests all seem to be passing now as desired.

If anyone wants more tests cases let me know, but I think this covers the ones called out explicitly in the issue.

Selected Reviewer: @Kludex

@dmontagu
Copy link
Contributor Author

please review

@dmontagu dmontagu merged commit a08dda7 into main Jun 14, 2023
53 checks passed
@dmontagu dmontagu deleted the email-regex-fix branch June 14, 2023 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deserialization of email with a dot in the name in NameEmail
2 participants