feat(isMobilePhone): Add South Sudan Locale And Prefix(SS) by cheboi · Pull Request #2084 · validatorjs/validator.js
Hello all,
After reading the provided reference, I think the RegExp is too permissive currently and would match invalid phone numbers as well.
According to the reference above, there are only 4 valid "mobile access codes":
- 91
- 92
- 95
- 97
So the RegExp should actually check for these as well.
Currently it only checks for that first 9, so an invalid number like the following would match as valid;
+211932345678 (invalid, because mobile access code 93 does not exist)
Not an expert on South Sudan though, so please correct me if I am wrong.
However, If I am right, the corrected RegExp in my opinion should look like this:
/^(\+?211|0)(9[1257])\d{7}$/
Examples:
Valid:
+211911234567
+211921234567
+211951234567
+211971234567
Invalid:
+211981234567
+211931234567
+211901234567
+211991234567