Skip to content

Commit

Permalink
Make zip_regex and partial_zip_regex patterns JS-compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
rochlefebvre committed Dec 19, 2024
1 parent f4e9b0b commit 5bd70fa
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion data/regions/AC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ code: AC
unit_system: metric
currency: SHP
zip_example: ASCN 1ZZ
zip_regex: "\\A[Aa][Ss][Cc][Nn]\\s*1[Zz][Zz]\\z"
zip_regex: "^[Aa][Ss][Cc][Nn]\\s*1[Zz][Zz]$"
phone_number_prefix: 247
zip_autofill_enabled: true
format:
Expand Down
2 changes: 1 addition & 1 deletion data/regions/CA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tax: 0.05
currency: CAD
unit_system: metric
tax_name: GST
zip_regex: "\\A[A-Za-z]\\d[A-Za-z]\\s*\\d[A-Za-z]\\d\\z"
zip_regex: "^[A-Za-z]\\d[A-Za-z]\\s*\\d[A-Za-z]\\d$"
partial_zip_regex: "^[A-Z][0-9][A-Z]$"
group: North American Countries
group_name: North America
Expand Down
2 changes: 1 addition & 1 deletion data/regions/IN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ tax_name: CGST
tax_inclusive: true
group: Asian Countries
group_name: Asia
zip_regex: "\\A\\d{6}\\z"
zip_regex: "^\\d{6}$"
zip_example: '110034'
phone_number_prefix: 91
week_start_day: monday
Expand Down
4 changes: 2 additions & 2 deletions data/regions/JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ tax_inclusive: true
group: Asian Countries
group_name: Asia
zip_example: 154-0023
zip_regex: "\\A〒?(\\d{7}|[0-9|0-9]{3}(-|ー)[0-9|0-9]{4})\\z"
partial_zip_regex: "\\A〒?([0-9|0-9]{0,3})(-|ー?)([0-9|0-9]{0,4})\\z"
zip_regex: "^〒?(\\d{7}|[0-9|0-9]{3}(-|ー)[0-9|0-9]{4})$"
partial_zip_regex: "^〒?([0-9|0-9]{0,3})(-|ー?)([0-9|0-9]{0,4})$"
phone_number_prefix: 81
building_number_required: true
building_number_may_be_in_address2: true
Expand Down
2 changes: 1 addition & 1 deletion data/regions/KR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ unit_system: metric
tax_name: VAT
group: Asian Countries
group_name: Asia
zip_regex: "\\A(\\d{5}|\\d{3}-\\d{3})\\z"
zip_regex: "^(\\d{5}|\\d{3}-\\d{3})$"
zip_example: '01600'
phone_number_prefix: 82
week_start_day: sunday
Expand Down
2 changes: 1 addition & 1 deletion data/regions/MQ.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ group_name: Central America
tags:
- EU-OMR
zip_example: '97220'
zip_regex: "\\A(MQ-?)?((972)\\d{2,2})\\z"
zip_regex: "^(MQ-?)?((972)\\d{2,2})$"
phone_number_prefix: 596
format:
edit: "{country}_{firstName}{lastName}_{company}_{address1}_{address2}_{zip}{city}_{phone}"
Expand Down
2 changes: 1 addition & 1 deletion data/regions/NL.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ group: European Countries
group_name: Europe
tags:
- EU-member
zip_regex: "(?-mix:\\A[1-9][0-9]{3} ?[A-Z]{2}\\z)"
zip_regex: "^[1-9][0-9]{3} ?[A-Z]{2}$"
partial_zip_regex: "^\\d{4}$"
zip_example: 1065 AM
phone_number_prefix: 31
Expand Down
2 changes: 1 addition & 1 deletion data/regions/NZ.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ tax_name: GST
tax_inclusive: true
group: Oceanian Countries
group_name: Oceania
zip_regex: "\\A\\d{4}\\z"
zip_regex: "^\\d{4}$"
zip_example: '6001'
phone_number_prefix: 64
building_number_required: true
Expand Down
2 changes: 1 addition & 1 deletion data/regions/PH.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ tax_name: VAT
zone_key: province
group: Asian Countries
group_name: Asia
zip_regex: "\\A\\d{4}\\z"
zip_regex: "^\\d{4}$"
zip_example: '1008'
phone_number_prefix: 63
week_start_day: sunday
Expand Down
2 changes: 1 addition & 1 deletion data/regions/PM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tags:
- EU-OCT
zip_example: '97500'
phone_number_prefix: 508
zip_regex: "\\A(PM-?)?((975)\\d{2,2})\\z"
zip_regex: "^(PM-?)?((975)\\d{2,2})$"
format:
edit: "{country}_{firstName}{lastName}_{company}_{address1}_{address2}_{zip}{city}_{phone}"
show: "{firstName} {lastName}_{company}_{address1}_{address2}_{zip} {city}_{country}_{phone}"
Expand Down
2 changes: 1 addition & 1 deletion data/regions/SA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tax: 0.15
currency: SAR
unit_system: metric
tax_name: VAT
zip_regex: "(?-mix:\\A\\d{5}(-\\d{4})?\\z)"
zip_regex: "^\\d{5}(-\\d{4})?$"
zip_requirement: optional
group: Asian Countries
group_name: Asia
Expand Down
2 changes: 1 addition & 1 deletion data/regions/TA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ unit_system: metric
# Source: https://en.wikipedia.org/wiki/Saint_Helena_pound
currency: GBP
zip_example: TDCU 1ZZ
zip_regex: "\\A[Tt][Dd][Cc][Uu]\\s*1[Zz][Zz]\\z"
zip_regex: "^[Tt][Dd][Cc][Uu]\\s*1[Zz][Zz]$"
phone_number_prefix: 2908
zip_autofill_enabled: true
autofill_city_enabled: true
Expand Down
2 changes: 1 addition & 1 deletion data/regions/UA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tax_inclusive: true
group: European Countries
group_name: Europe
zip_example: '15432'
zip_regex: "\\A\\d{5}\\z"
zip_regex: "^\\d{5}$"
phone_number_prefix: 380
week_start_day: monday
format:
Expand Down
2 changes: 1 addition & 1 deletion data/regions/US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ group_name: North America
name_alternates:
- United States of America
zip_label: Zip code
zip_regex: "(?-mix:\\A\\d{5}(-\\d{4})?\\z)"
zip_regex: "^\\d{5}(-\\d{4})?$"
zip_example: '90210'
phone_number_prefix: 1
building_number_required: true
Expand Down

0 comments on commit 5bd70fa

Please sign in to comment.