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

feat: update email validation pattern #1937

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aniketkumar7
Copy link

aurelia/packages/validation/src/rule-provider.ts

Line 311 in 2fca6ea

const emailPattern = /^[a-zA-Z0-9.!#$%&'+/=?^_`{|}~-]+@a-zA-Z0-9?(?:.a-zA-Z0-9?)$/;
Not sure if this is the intended behavior.

At the moment the behaviour is like this

test -> not valid
test@ -> not valid
test@test -> valid
test@test. -> not valid
[email protected] -> valid

Should test@test also not be valid?

If yes, then changing the regex to something like this:

^[a-zA-Z0-9.!#$%&'+/=?^_`{|}~-]+@a-zA-Z0-9?(?:.a-zA-Z0-9?).[a-zA-Z0-9]{2,}$

I have change the emailpattern, please review it and merge my pull request

@Sayan751
Copy link
Contributor

Sayan751 commented Apr 6, 2024

Hi @aniketkumar7! Thanks for the contribution. Please add relevant tests for your change.

@aniketkumar7
Copy link
Author

Sorry @Sayan751 , I am not able to add relevent test for the change.

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

Successfully merging this pull request may close these issues.

None yet

2 participants