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

Email type is not proper validating emails #78

Closed
alguerocode opened this issue Jan 31, 2022 · 4 comments
Closed

Email type is not proper validating emails #78

alguerocode opened this issue Jan 31, 2022 · 4 comments
Assignees
Labels
good first issue Good for newcomers 💡 idea Idea for improve volder package wontfix This will not be worked on
Milestone

Comments

@alguerocode
Copy link
Member

the Email type function is not properly validate email correctly we need more improvement. and accept mutliemail styles not only the Gmail style

this is current Email function:

export const Email = (input) => {
  const regex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/

  return regex.test(String(input))
};
@alguerocode alguerocode added good first issue Good for newcomers 💡 idea Idea for improve volder package labels Jan 31, 2022
@batunpc
Copy link
Contributor

batunpc commented Feb 1, 2022

const Email = (input) => { return /[^@ \t\r\n]+@[^@ \t\r\n]+\.[^@ \t\r\n]+/.test(input); }
This change in the regexp might be helpful to validate/accept "mutliemail" styles.

@alguerocode
Copy link
Member Author

alguerocode commented Feb 1, 2022

const Email = (input) => { return /[^@ \t\r\n]+@[^@ \t\r\n]+\.[^@ \t\r\n]+/.test(input); } This change in the regexp might be helpful to validate/accept "mutliemail" styles.

the email structure [email name]@[domain name]
the current email regex it's true, but the email name wants some changes:

  • add more symbols to accept them and it's : & + ~
  • email don't accept the email names that start with symbols.

so, the top 2 is the real problem we want to solve and i will wait until you reply .
thanks for contributing.

@alguerocode alguerocode added the wontfix This will not be worked on label Feb 1, 2022
@batunpc
Copy link
Contributor

batunpc commented Feb 2, 2022

^[\w.+~&\-]+@[a-zA-Z\d.-]+\.[a-zA-Z]{2,6}

This will match in the beginning [email name] if there is
\w (alphanumeric or underscore character with the stated symbols &,+,~) followed by domain name.

I tested from here regex101
I hope this helps:)

@alguerocode
Copy link
Member Author

alguerocode commented Feb 2, 2022

thanks and , finally create pull request with that changes

@alguerocode alguerocode changed the title email type is not proper Email type is not proper validating emails Feb 2, 2022
@alguerocode alguerocode added this to the 3.0.0 milestone Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers 💡 idea Idea for improve volder package wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants