Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
fix bug validate email (#986)
Browse files Browse the repository at this point in the history
  • Loading branch information
Derryrover authored Nov 1, 2021
1 parent 21abfb1 commit bca8baa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/form/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ export const jsonValidator = (jsonStr: string) => {
};

export const emailValidator = (address: string) => {
if (/^\w+([+.-]\w+)*@\w+([.-]\w+)*(\.\w{2,3})+$/.test(address)) {
// http://emailregex.com/
// https://github.com/nens/lizard-management-client/issues/985
//eslint-disable-next-line
if (/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(address)) {
return false;
};
return 'Please enter a valid email address';
Expand Down

0 comments on commit bca8baa

Please sign in to comment.