@cnamts/vue-dot
Version:
Implementation of our Design System for the French Health Insurance
8 lines (6 loc) • 351 B
text/typescript
/** From https://emailregex.com/ */
export const EMAIL_REGEXP = /^(([^<>()[\]\\.,;:\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,}))$/;
/** Check if an email is valid */
export function isEmailValid(email: string): boolean {
return Boolean(EMAIL_REGEXP.exec(email));
}