Adjusted email validation in frontend

This commit is contained in:
Philipp Czora
2019-02-13 15:16:01 +01:00
parent 093019a918
commit 5eb32d32b2
2 changed files with 5 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ export const isNameValid = (name: string) => {
return nameRegex.test(name);
};
const mailRegex = /^[A-z0-9][\w.-]*@[A-z0-9][\w\-.]*\.[A-z0-9][A-z0-9-]+$/;
const mailRegex = /^[ -~]+@[A-Za-z0-9][\w\-.]*\.[A-Za-z0-9][A-Za-z0-9-]+$/;
export const isMailValid = (mail: string) => {
return mailRegex.test(mail);