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

Invalid Russian passport number regex #1807

Closed
Chormon opened this issue Oct 19, 2021 · 10 comments · Fixed by #1810
Closed

Invalid Russian passport number regex #1807

Chormon opened this issue Oct 19, 2021 · 10 comments · Fixed by #1810

Comments

@Chormon
Copy link

Chormon commented Oct 19, 2021

International Russian passport contains 9 digits, not 10:

RU: /^\d{2}\d{2}\d{6}$/, // RUSSIAN FEDERATION

@tux-tn
Copy link
Member

tux-tn commented Oct 19, 2021

Thank you for reporting this issue @Chormon. Looks like the person that added the validation mixed between internal and international passport number.

An international passport number has nine digits, one digit fewer than the internal passport number. The first two digits can indicate that the passport holder (or a family member) is a government official (10) or a diplomat (20). However, international passport numbers do not offer as much insight as internal passport numbers. Region and year of issue do not form part of the number as they do in internal passport numbers.

Source

PRs are welcome!

@Theta-Dev
Copy link
Contributor

So should it accept both or only international passport numbers?
I can fix this after clarification.

@Chormon
Copy link
Author

Chormon commented Oct 19, 2021

As far as I understand, domestic passport is more like ID card.

@Tharunkumar1411
Copy link

can you assign this issue for me?

@tux-tn
Copy link
Member

tux-tn commented Oct 19, 2021

So should it accept both or only international passport numbers? I can fix this after clarification.

Looks like only 9 digit passport numbers are valid. The 10 digit version is as Chromon said used like an ID Card.

can you assign this issue for me?

@Tharunkumar001 sorry but @Theta-Dev asked first 😅 Feel free to pick another issue or check #1761 if you want to contribute as part of hacktoberfest

@Theta-Dev
Copy link
Contributor

Theta-Dev commented Oct 19, 2021

Why is the regex actually seperated into 3 groups instead of simply ^\d{10}$?

@tux-tn
Copy link
Member

tux-tn commented Oct 19, 2021

Why is the regex actually seperated into 3 groups instead of simply ^\d{10}$?

No idea, you will probably want to change that too 😅

@fkashrafi
Copy link

Hey, can you assign me this task?

@ChandanChainani
Copy link

@tux-tn please close the issue as it is already been fixed

@tux-tn
Copy link
Member

tux-tn commented Oct 28, 2021

@tux-tn please close the issue as it is already been fixed

Thank you but the PR has not been merged yet

profnandaa pushed a commit that referenced this issue Oct 30, 2021
* fix: Russian passport number regex

fixes #1807
theteladras pushed a commit to theteladras/validator.js that referenced this issue Oct 30, 2021
profnandaa pushed a commit that referenced this issue Oct 31, 2021
* fix: Russian passport number regex

fixes #1807
profnandaa pushed a commit that referenced this issue Oct 31, 2021
* fix: Russian passport number regex

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

Successfully merging a pull request may close this issue.

6 participants