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

blacklist chars of the localpart or userpart of internatinalize emails address #2523

Open
AkaeyesWanabe opened this issue Jan 28, 2025 · 5 comments

Comments

@AkaeyesWanabe
Copy link

Hello ! Could i know or get the list of blacklist characters of the userpart or localpart of internationalized email address.
Thank you.

@WikiRik
Copy link
Member

WikiRik commented Jan 28, 2025

It depends on the options used, but I think you want either of these two regular expressions;

const emailUserUtf8Part = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i;
const quotedEmailUserUtf8 = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;

Check out the rest of the file as well to see what the validator does.

@AkaeyesWanabe
Copy link
Author

Super thank you for explanations. it's great

@AkaeyesWanabe
Copy link
Author

Now i want to know if some characters such as "?" ou "!" are valid characters and why?
you can see my hypothesis:
-it can be valid in non-internationalized emails and so will become valid in inernationalized email...
-they are only valid in internationalized emails.

Could i have somes documentations about invalid or valid characters in internationalized email addresses.
Really, Our team try to make a loca function to validate internationalized email addresses in PHP.

@WikiRik
Copy link
Member

WikiRik commented Jan 29, 2025

Could i have somes documentations about invalid or valid characters in internationalized email addresses.

That would be part of the RFCs relating to email itself and that exact knowledge is not something we as maintainers have. A start on how email addresses are built up and which RFCs are related to that can be given by reading the Wikipedia page; https://en.wikipedia.org/wiki/Email_address

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@WikiRik @AkaeyesWanabe and others