Skip to content

Commit

Permalink
Merge pull request #1 from benjaminlhai/fix/au_passport_regex
Browse files Browse the repository at this point in the history
added updated regex for AU passports and updated tests
  • Loading branch information
benjaminlhai authored Jul 31, 2024
2 parents ffb23f7 + ec4fe27 commit daccce9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyvalidator/is_passport_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"AM": r"^[A-Z]{2}\d{7}$", # ARMENIA
"AR": r"^[A-Z]{3}\d{6}$", # ARGENTINA
"AT": r"^[A-Z]\d{7}$", # AUSTRIA
"AU": r"^[A-Z]\d{7}$", # AUSTRALIA
"AU": r"^([A-Z]{2}\d{7}|[A-Z]{1}\d{7})$", # AUSTRALIA
"BA": r"^[A-Z]\d{7}$", # BOSNIA AND HERZEGOVINA,
"BE": r"^[A-Z]{2}\d{6}$", # BELGIUM
"BG": r"^\d{9}$", # BULGARIA
Expand Down
2 changes: 2 additions & 0 deletions test/test_is_passport_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def test_valid_passport_number(self):
['P 1630837', "AT"],
['P 4366918', "AT"],
['N0995852', "AU"],
['PN0995852', "AU"],
['L4819236', "AU"],
['A1234567', "BA"],
['346395366', "BG"],
Expand Down Expand Up @@ -105,6 +106,7 @@ def test_invalid_passport_number(self):
['A11811035', "AR"],
['0 1630837', "AT"],
['1A012345', "AU"],
['1AP012345', "AU"],
['ABC123456', "BA"],
['ABC123456', "BG"],
['ABX29332', "BR"],
Expand Down

0 comments on commit daccce9

Please sign in to comment.