verdnatura-chat/app/utils/isValidEmail.ts

7 lines
299 B
TypeScript
Raw Normal View History

export default function isValidEmail(email: string): boolean {
2018-12-05 20:52:08 +00:00
/* eslint-disable no-useless-escape */
const reg =
/^(([^<>()\[\]\\.,;:\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,}))$/;
2018-12-05 20:52:08 +00:00
return reg.test(email);
}