Skip to content

Commit

Permalink
fix: validator for mail
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliaghisini committed Mar 13, 2024
1 parent 0f846b8 commit eded840
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const isValidEmail = (email) => {
// Email Regex taken from from WHATWG living standard:
// https://html.spec.whatwg.org/multipage/input.html#e-mail-state-(type=email)
const emailRegex =
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)$/;
/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9.](?:[a-zA-Z0-9-.]{0,61}[a-zA-Z0-9.])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)$/;
const isValid = emailRegex.test(email);
return isValid;
};

0 comments on commit eded840

Please sign in to comment.