You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently noticed that the regular expression for Tajikistan (tg-TJ) in validator.js is incorrect. Currently, it does not properly validate all valid Tajik phone numbers.
The regex does not account for all valid mobile operator codes in Tajikistan.
Some valid phone numbers are incorrectly rejected.
Suggested Fix
The correct phone number format should include the following valid operator codes:
00, 55, 88, 90, 91, 92, 93, 95, 98, 99
A more accurate regex would be: /^(\+992|992)?(00|55|88|90|91|92|93|95|98|99)\d{7}$/
Validator.js version: 13.15.0
Node.js version: v20.9.0
OS platform: macOS
The text was updated successfully, but these errors were encountered:
I’m interested in resolving this issue. The phone numbers provided are valid and sourced from the official Tajikistan Telecommunications page on the WFP Logistics Cluster website: https://lca.logcluster.org/34-tajikistan-telecommunications
ShreySinha02
pushed a commit
to ShreySinha02/validator.js
that referenced
this issue
Apr 17, 2025
I recently noticed that the regular expression for Tajikistan (tg-TJ) in validator.js is incorrect. Currently, it does not properly validate all valid Tajik phone numbers.
Valid Tajikistan Phone Numbers (Should Pass Validation)
+992 90 1234567
+992 91 7654321
(this phone numbers can't pass the validation)
Reproductions
Suggested Fix
The correct phone number format should include the following valid operator codes:
00, 55, 88, 90, 91, 92, 93, 95, 98, 99
A more accurate regex would be:
/^(\+992|992)?(00|55|88|90|91|92|93|95|98|99)\d{7}$/
Validator.js version: 13.15.0
Node.js version: v20.9.0
OS platform: macOS
The text was updated successfully, but these errors were encountered: