-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Description
const emailReg = new 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,}))$/
);
/**
* Validate email function with regular expression
*
* If email isn't valid then return false
*
* @param email
* @return Boolean
*/
export const validateEmail = (email: string): boolean => emailReg.test(email);
I use this function in several projects. I think it's more robust than the regex option here, but I need all your other options, so what do you think?
thanks
Metadata
Metadata
Assignees
Labels
No labels