Sample JavaScript:
let strEmail = 'test@test';
let strEmailRegEx = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
console.log(
'Is Email ' + strEmail + ' valid?',
strEmailRegEx.test(
strEmail
)
);
strEmail = '[email protected]';
console.log(
'Is Email ' + strEmail + ' valid?',
strEmailRegEx.test(
strEmail
)
);