diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js index e543cd3c3..e5fb6bffd 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -151,7 +151,7 @@ const phones = { 'th-TH': /^(\+66|66|0)\d{9}$/, 'tr-TR': /^(\+?90|0)?5\d{9}$/, 'tk-TM': /^(\+993|993|8)\d{8}$/, - 'uk-UA': /^(\+?38|8)?0\d{9}$/, + 'uk-UA': /^(\+?38)?0(50|6[36-8]|7[357]|9[1-9])\d{7}$/, 'uz-UZ': /^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/, 'vi-VN': /^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/, 'zh-CN': /^((\+|00)86)?(1[3-9]|9[28])\d{9}$/, diff --git a/test/validators.test.js b/test/validators.test.js index 94fe3b8bb..b9829faae 100644 --- a/test/validators.test.js +++ b/test/validators.test.js @@ -9427,16 +9427,67 @@ describe('Validators', () => { { locale: 'uk-UA', valid: [ - '+380982345679', - '380982345679', - '80982345679', - '0982345679', + '+380501234567', + '+380631234567', + '+380661234567', + '+380671234567', + '+380681234567', + '+380731234567', + '+380751234567', + '+380771234567', + '+380911234567', + '+380921234567', + '+380931234567', + '+380941234567', + '+380951234567', + '+380961234567', + '+380971234567', + '+380981234567', + '+380991234567', + '380501234567', + '380631234567', + '380661234567', + '380671234567', + '380681234567', + '380731234567', + '380751234567', + '380771234567', + '380911234567', + '380921234567', + '380931234567', + '380941234567', + '380951234567', + '380961234567', + '380971234567', + '380981234567', + '380991234567', + '0501234567', + '0631234567', + '0661234567', + '0671234567', + '0681234567', + '0731234567', + '0751234567', + '0771234567', + '0911234567', + '0921234567', + '0931234567', + '0941234567', + '0951234567', + '0961234567', + '0971234567', + '0981234567', + '0991234567', ], invalid: [ '+30982345679', + '+380321234567', + '+380441234567', '982345679', + '80982345679', '+380 98 234 5679', '+380-98-234-5679', + '+380 (98) 234-56-79', '', 'ASDFGJKLmZXJtZtesting123', '123456',