diff --git a/src/lib/isPassportNumber.js b/src/lib/isPassportNumber.js index b8d95d54a..76284b12f 100644 --- a/src/lib/isPassportNumber.js +++ b/src/lib/isPassportNumber.js @@ -17,7 +17,7 @@ const passportRegexByCountryCode = { BY: /^[A-Z]{2}\d{7}$/, // BELARUS CA: /^[A-Z]{2}\d{6}$/, // CANADA CH: /^[A-Z]\d{7}$/, // SWITZERLAND - CN: /^[GE](?![IO])[A-Z0-9]\d{7}$/, // CHINA [G=Ordinary, E=Electronic] followed by 8-digits, or an UPPERCASE letter (except I and O) followed by 7 digits + CN: /^G\d{8}$|^E(?![IO])[A-Z0-9]\d{7}$/, // CHINA [G=Ordinary, E=Electronic] followed by 8-digits, or E followed by any UPPERCASE letter (except I and O) followed by 7 digits CY: /^[A-Z](\d{6}|\d{8})$/, // CYPRUS CZ: /^\d{8}$/, // CZECH REPUBLIC DE: /^[CFGHJKLMNPRTVWXYZ0-9]{9}$/, // GERMANY diff --git a/test/validators.js b/test/validators.js index 2fb40429c..a6ed839cb 100644 --- a/test/validators.js +++ b/test/validators.js @@ -2476,12 +2476,12 @@ describe('Validators', () => { 'G25352389', 'E00160027', 'EA1234567', - 'GB1234567', ], invalid: [ 'K0123456', 'E-1234567', 'G.1234567', + 'GA1234567', 'EI1234567', 'GO1234567', ],