Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Georgian phone number validation bug #1950

Closed
avkvak opened this issue Mar 31, 2022 · 6 comments
Closed

Georgian phone number validation bug #1950

avkvak opened this issue Mar 31, 2022 · 6 comments
Labels

Comments

@avkvak
Copy link

avkvak commented Mar 31, 2022

Describe the bug
Currently Georgian phone regexp looks like this:
'ka-GE': /^(+?995)?(5|79)\d{7}$/,

Examples
But in this time phone started with +995 5... validator is missing one digit:
https://en.wikipedia.org/wiki/Telephone_numbers_in_Georgia_(country)

thus,
+995 500 000 000 is a real phone number that is not valid from the point of view of the regular expression
while in this time
+995 500 000 00 isn't a real numer, but valid here

At the same time, numbers starting with +995 79.. currently validates correctly

Additional context
Validator.js version: latest
Node.js version: doesn't matter
OS platform: [windows, linux, macOS, etc]: doesn't matter

@WikiRik
Copy link
Member

WikiRik commented Mar 31, 2022

Would /^(\+?995)?(79\d{7}|5\d{8})$/ be a correct expression? If so, feel free to submit a PR with updated tests

@avkvak
Copy link
Author

avkvak commented Mar 31, 2022

Would /^(\+?995)?(79\d{7}|5\d{8})$/ be a correct expression? If so, feel free to submit a PR with updated tests

Now I trying to figure out is it correct regexp. According to Wikipedia, phone numbers can begin not only with 5 or 79. It is curious to know why these particular digist are highlighted in the regular expression, excluding other options

@rubiin
Copy link
Member

rubiin commented Jul 28, 2022

closed as merged

@rubiin rubiin closed this as completed Jul 28, 2022
@msgania
Copy link

msgania commented Dec 20, 2022

Hello.
Why is the code in the master branch corrected, but incorrect in the npm package?
Version 13.7.0

@WikiRik
Copy link
Member

WikiRik commented Dec 20, 2022

The master branch does not reflect the code as shipped in v13.7.0. This fix will be a part of the next release which will come out in mid-January 2023

@litehacker
Copy link

In case you want to validate Georgian number, you can use this regex:
/^(\+\d{3}\s?)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{3}$/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants