7 lines
294 B
JavaScript
7 lines
294 B
JavaScript
|
export const validateEmail = (control, value) => {
|
||
|
if (typeof value !== 'string') {
|
||
|
return false;
|
||
|
}
|
||
|
return value.toLowerCase().match(/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/) !== null;
|
||
|
}
|