Lista Friends
This commit is contained in:
@@ -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 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user