Lista Friends

This commit is contained in:
paoloar77
2022-01-05 19:11:47 +01:00
parent 0997ef1ec3
commit a1f2ced085
46 changed files with 282 additions and 13236 deletions

View File

@@ -9,8 +9,10 @@ export default function useValidators() {
}
const isEmail = (fieldName: string, fieldValue: string) => {
let re = /^(([^<>()[\]\\.,;:\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,}))$/;
return !re.test(fieldValue) ? 'The input is not a valid ' + fieldName + ' address' : '';
const res = /^(([^<>()\[\]\\.,;:\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,}))$/;
return !res.test(String(fieldValue).toLowerCase()) ? 'The input is not a valid ' + fieldName + ' address' : '';
// let re = /^(([^<>()[\]\\.,;:\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,}))$/;
// return !re.test(fieldValue) ? 'The input is not a valid ' + fieldName + ' address' : '';
}
return { isEmpty, minLength, isEmail }
}