diff --git a/src/lib/isEmail.js b/src/lib/isEmail.js index ecbd398c9..8f1dcd98a 100644 --- a/src/lib/isEmail.js +++ b/src/lib/isEmail.js @@ -110,7 +110,7 @@ export default function isEmail(str, options) { const username = user.split('+')[0]; // Dots are not included in gmail length restriction - if (!isByteLength(username.replace('.', ''), { min: 6, max: 30 })) { + if (!isByteLength(username.replace(/\./g, ''), { min: 6, max: 30 })) { return false; } diff --git a/test/validators.js b/test/validators.js index 6bb607282..186d7a215 100644 --- a/test/validators.js +++ b/test/validators.js @@ -70,7 +70,7 @@ describe('Validators', () => { 'hans@m端ller.com', 'test|123@m端ller.com', 'test123+ext@gmail.com', - 'some.name.midd.leNa.me+extension@GoogleMail.com', + 'some.name.midd.leNa.me.and.locality+extension@GoogleMail.com', '"foobar"@example.com', '" foo m端ller "@example.com', '"foo\\@bar"@example.com',