think/packages/client/src/helpers/validator.ts

8 lines
260 B
TypeScript
Raw Normal View History

2022-06-28 16:04:22 +00:00
export const isEmail = (email) => {
return !!String(email)
.toLowerCase()
.match(
/^(([^<>()[\]\\.,;:\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,}))$/
);
};