module ValidateZipcode::Regex
Public Class Methods
Afghanistan
# File lib/validate_zipcode/regex.rb, line 4 def self.AF(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Albania
# File lib/validate_zipcode/regex.rb, line 14 def self.AL(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Armenia
# File lib/validate_zipcode/regex.rb, line 34 def self.AM(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Argentina
# File lib/validate_zipcode/regex.rb, line 29 def self.AR(zipcode) match = zipcode =~ /^([a-zA-Z][0-9]{4}[a-zA-Z]{3})$/ match == 0 ? true : false end
American Samoa
# File lib/validate_zipcode/regex.rb, line 24 def self.AS(zipcode) match = zipcode =~ /^([0-9]{5})$|([0-9]{9})$|([0-9]{5}-[0-9]{4})$/ match == 0 ? true : false end
Austria
# File lib/validate_zipcode/regex.rb, line 44 def self.AT(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Australia
# File lib/validate_zipcode/regex.rb, line 39 def self.AU(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Aland Islands
# File lib/validate_zipcode/regex.rb, line 9 def self.AX(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Azerbaijan
# File lib/validate_zipcode/regex.rb, line 49 def self.AZ(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
BA
Bosnia and Herzegovina
# File lib/validate_zipcode/regex.rb, line 79 def self.BA(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Bangladesh
# File lib/validate_zipcode/regex.rb, line 54 def self.BD(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Belgium
# File lib/validate_zipcode/regex.rb, line 64 def self.BE(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Bulgaria
# File lib/validate_zipcode/regex.rb, line 94 def self.BG(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Brunei Darussalam
# File lib/validate_zipcode/regex.rb, line 89 def self.BN(zipcode) match = zipcode =~ /^([a-zA-Z]{2}[0-9]{4})$/ match == 0 ? true : false end
Bolivia
# File lib/validate_zipcode/regex.rb, line 74 def self.BO(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Brazil
# File lib/validate_zipcode/regex.rb, line 84 def self.BR(zipcode) match = zipcode =~ /^([0-9]{5}-[0-9]{3})$|([0-9]{8})$/ match == 0 ? true : false end
Bhutan
# File lib/validate_zipcode/regex.rb, line 69 def self.BT(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Belarus
# File lib/validate_zipcode/regex.rb, line 59 def self.BY(zipcode) match = zipcode =~ /^([0-9]{6})$/ match == 0 ? true : false end
Canada
# File lib/validate_zipcode/regex.rb, line 109 def self.CA(zipcode) match = zipcode =~ /^([a-zA-Z][0-9][a-zA-Z][ ][0-9][a-zA-Z][0-9])$|([a-zA-Z][0-9][a-zA-Z][0-9][a-zA-Z][0-9])$|([a-zA-Z][0-9][a-zA-Z]-[0-9][a-zA-Z][0-9])/ match == 0 ? true : false end
Cocos (Keeling) Islands
# File lib/validate_zipcode/regex.rb, line 129 def self.CC(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Switzerland
# File lib/validate_zipcode/regex.rb, line 584 def self.CH(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Chile
# File lib/validate_zipcode/regex.rb, line 114 def self.CL(zipcode) match = zipcode =~ /^([0-9]{3}-[0-9]{4})$|([0-9]{7})$/ match == 0 ? true : false end
China
# File lib/validate_zipcode/regex.rb, line 119 def self.CN(zipcode) match = zipcode =~ /^([0-9]{6})$/ match == 0 ? true : false end
Colombia
# File lib/validate_zipcode/regex.rb, line 134 def self.CO(zipcode) match = zipcode =~ /^([0-9]{6})$/ match == 0 ? true : false end
Costa Rica
# File lib/validate_zipcode/regex.rb, line 139 def self.CR(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Montenegro
# File lib/validate_zipcode/regex.rb, line 459 def self.CS(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Cuba
# File lib/validate_zipcode/regex.rb, line 149 def self.CU(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Cabo Verde
# File lib/validate_zipcode/regex.rb, line 99 def self.CV(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Christmas Island
# File lib/validate_zipcode/regex.rb, line 124 def self.CX(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Cyprus
# File lib/validate_zipcode/regex.rb, line 154 def self.CY(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Czech Republic
# File lib/validate_zipcode/regex.rb, line 159 def self.CZ(zipcode) match = zipcode =~ /^([0-9]{3}[ ][0-9]{2})$|([0-9]{5})$/ match == 0 ? true : false end
Deutsch or Germany
# File lib/validate_zipcode/regex.rb, line 169 def self.DE(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Denmark
# File lib/validate_zipcode/regex.rb, line 164 def self.DK(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Dominican Republic
# File lib/validate_zipcode/regex.rb, line 174 def self.DO(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Algeria
# File lib/validate_zipcode/regex.rb, line 19 def self.DZ(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Ecuador
# File lib/validate_zipcode/regex.rb, line 179 def self.EC(zipcode) match = zipcode =~ /^([0-9]{6})$/ match == 0 ? true : false end
Estonia
# File lib/validate_zipcode/regex.rb, line 194 def self.EE(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Egypt
# File lib/validate_zipcode/regex.rb, line 184 def self.EG(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Spain
# File lib/validate_zipcode/regex.rb, line 564 def self.ES(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Ethiopia
# File lib/validate_zipcode/regex.rb, line 199 def self.ET(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Finland
# File lib/validate_zipcode/regex.rb, line 204 def self.FI(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Federated States of Micronesia
# File lib/validate_zipcode/regex.rb, line 439 def self.FM(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
France
# File lib/validate_zipcode/regex.rb, line 209 def self.FR(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Georgia
# File lib/validate_zipcode/regex.rb, line 224 def self.GE(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
French Guiana
# File lib/validate_zipcode/regex.rb, line 214 def self.GF(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Greenland
# File lib/validate_zipcode/regex.rb, line 234 def self.GL(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Guadeloupe
# File lib/validate_zipcode/regex.rb, line 239 def self.GP(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Greece
# File lib/validate_zipcode/regex.rb, line 229 def self.GR(zipcode) match = zipcode =~ /^([0-9]{3}[ ][0-9]{2})$|([0-9]{5})$|([0-9]{3}-[0-9]{2})$/ match == 0 ? true : false end
Guatemala
# File lib/validate_zipcode/regex.rb, line 244 def self.GT(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Guinea-Bissau
# File lib/validate_zipcode/regex.rb, line 249 def self.GW(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Heard Island and McDonald Islands
# File lib/validate_zipcode/regex.rb, line 259 def self.HM(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Honduras
# File lib/validate_zipcode/regex.rb, line 269 def self.HN(zipcode) match = zipcode =~ /^([a-zA-Z]{2}[0-9]{4})$/ match == 0 ? true : false end
Croatia
# File lib/validate_zipcode/regex.rb, line 144 def self.HR(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Haiti
# File lib/validate_zipcode/regex.rb, line 254 def self.HT(zipcode) match = zipcode =~ /^([hH][tT][0-9]{4})$|([0-9]{4})$/ match == 0 ? true : false end
Hungary
# File lib/validate_zipcode/regex.rb, line 274 def self.HU(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Indonesia
# File lib/validate_zipcode/regex.rb, line 289 def self.ID(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Israel
# File lib/validate_zipcode/regex.rb, line 304 def self.IL(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
India
# File lib/validate_zipcode/regex.rb, line 284 def self.IN(zipcode) match = zipcode =~ /^([0-9]{6})$/ match == 0 ? true : false end
Iraq
# File lib/validate_zipcode/regex.rb, line 299 def self.IQ(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Iran
# File lib/validate_zipcode/regex.rb, line 294 def self.IR(zipcode) match = zipcode =~ /^([0-9]{10})$/ match == 0 ? true : false end
Iceland
# File lib/validate_zipcode/regex.rb, line 279 def self.IS(zipcode) match = zipcode =~ /^([0-9]{3})$/ match == 0 ? true : false end
Italy
# File lib/validate_zipcode/regex.rb, line 309 def self.IT(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Jordan
# File lib/validate_zipcode/regex.rb, line 319 def self.JO(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Japan
# File lib/validate_zipcode/regex.rb, line 314 def self.JP(zipcode) match = zipcode =~ /^([0-9]{3}-[0-9]{4})$|([0-9]{7})$/ match == 0 ? true : false end
Kenya
# File lib/validate_zipcode/regex.rb, line 329 def self.KE(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Kyrgyzstan
# File lib/validate_zipcode/regex.rb, line 344 def self.KG(zipcode) match = zipcode =~ /^([0-9]{6})$/ match == 0 ? true : false end
Cambodia
# File lib/validate_zipcode/regex.rb, line 104 def self.KH(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : fals end
KR
- Republic of Korea
# File lib/validate_zipcode/regex.rb, line 334 def self.KR(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Kuwait
# File lib/validate_zipcode/regex.rb, line 339 def self.KW(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Kazakhstan
# File lib/validate_zipcode/regex.rb, line 324 def self.KZ(zipcode) match = zipcode =~ /^([0-9]{6})$/ match == 0 ? true : false end
Laos
# File lib/validate_zipcode/regex.rb, line 349 def self.LA(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Lebanon
# File lib/validate_zipcode/regex.rb, line 359 def self.LB(zipcode) match = zipcode =~ /^([0-9]{4}[ ][0-9]{4})$|([0-9]{4})$/ match == 0 ? true : false end
Liechtenstein
# File lib/validate_zipcode/regex.rb, line 374 def self.LI(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Sri Lanka
# File lib/validate_zipcode/regex.rb, line 569 def self.LK(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Liberia
# File lib/validate_zipcode/regex.rb, line 369 def self.LR(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Lesotho
# File lib/validate_zipcode/regex.rb, line 364 def self.LS(zipcode) match = zipcode =~ /^([0-9]{3})$/ match == 0 ? true : false end
Lithuania
# File lib/validate_zipcode/regex.rb, line 379 def self.LT(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Luxembourg
# File lib/validate_zipcode/regex.rb, line 384 def self.LU(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Latvia
# File lib/validate_zipcode/regex.rb, line 354 def self.LV(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Morocco
# File lib/validate_zipcode/regex.rb, line 469 def self.MA(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Monaco
# File lib/validate_zipcode/regex.rb, line 449 def self.MC(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Republic of Moldova
# File lib/validate_zipcode/regex.rb, line 444 def self.MD(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Madagascar
# File lib/validate_zipcode/regex.rb, line 394 def self.MG(zipcode) match = zipcode =~ /^([0-9]{3})$/ match == 0 ? true : false end
Marshall Islands
# File lib/validate_zipcode/regex.rb, line 414 def self.MH(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Macedonia
# File lib/validate_zipcode/regex.rb, line 389 def self.MK(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Myanmar
# File lib/validate_zipcode/regex.rb, line 479 def self.MM(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Mongolia
# File lib/validate_zipcode/regex.rb, line 454 def self.MN(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Martinique
# File lib/validate_zipcode/regex.rb, line 419 def self.MQ(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Montserrat
# File lib/validate_zipcode/regex.rb, line 464 def self.MS(zipcode) match = zipcode =~ /^([mM][sS][rR][0-9]{4})$|([0-9]{4})$/ match == 0 ? true : false end
Malta
# File lib/validate_zipcode/regex.rb, line 409 def self.MT(zipcode) match = zipcode =~ /^([a-zA-Z]{3}[ ][0-9]{4})$|([a-zA-Z]{3}[0-9]{4})$/ match == 0 ? true : false end
Mauritius
# File lib/validate_zipcode/regex.rb, line 424 def self.MU(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Maldives
# File lib/validate_zipcode/regex.rb, line 404 def self.MV(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Mexico
# File lib/validate_zipcode/regex.rb, line 434 def self.MX(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Malaysia
# File lib/validate_zipcode/regex.rb, line 399 def self.MY(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Mozambique
# File lib/validate_zipcode/regex.rb, line 474 def self.MZ(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Namibia
# File lib/validate_zipcode/regex.rb, line 484 def self.NA(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Niger
# File lib/validate_zipcode/regex.rb, line 494 def self.NE(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Norway
# File lib/validate_zipcode/regex.rb, line 504 def self.NO(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Nepal
# File lib/validate_zipcode/regex.rb, line 489 def self.NP(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
New Zealand (including the Ross dependency)
# File lib/validate_zipcode/regex.rb, line 499 def self.NZ(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Peru
# File lib/validate_zipcode/regex.rb, line 514 def self.PE(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
French Polynesia
# File lib/validate_zipcode/regex.rb, line 219 def self.PF(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Philippines
# File lib/validate_zipcode/regex.rb, line 519 def self.PH(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Portugal
# File lib/validate_zipcode/regex.rb, line 524 def self.PT(zipcode) match = zipcode =~ /^([0-9]{4}-[0-9]{3})$|([0-9]{7})$/ match == 0 ? true : false end
Paraguay
# File lib/validate_zipcode/regex.rb, line 509 def self.PY(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Romania
# File lib/validate_zipcode/regex.rb, line 529 def self.RO(zipcode) match = zipcode =~ /^([0-9]{6})$/ match == 0 ? true : false end
Russian
# File lib/validate_zipcode/regex.rb, line 534 def self.RU(zipcode) match = zipcode =~ /^([0-9]{6})$/ match == 0 ? true : false end
Saudi Arabia
# File lib/validate_zipcode/regex.rb, line 539 def self.SA(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Sudan
# File lib/validate_zipcode/regex.rb, line 574 def self.SD(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Singapore
# File lib/validate_zipcode/regex.rb, line 549 def self.SG(zipcode) match = zipcode =~ /^([0-9]{6})$/ match == 0 ? true : false end
Slovenia
# File lib/validate_zipcode/regex.rb, line 554 def self.SI(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Svalbard and Jan Mayen Island
# File lib/validate_zipcode/regex.rb, line 579 def self.SJ(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Senegal
# File lib/validate_zipcode/regex.rb, line 544 def self.SN(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
El Salvador
# File lib/validate_zipcode/regex.rb, line 189 def self.SV(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Thailand
# File lib/validate_zipcode/regex.rb, line 594 def self.TH(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Tajikistan
# File lib/validate_zipcode/regex.rb, line 589 def self.TJ(zipcode) match = zipcode =~ /^([0-9]{6})$/ match == 0 ? true : false end
Turkmenistan
# File lib/validate_zipcode/regex.rb, line 614 def self.TM(zipcode) match = zipcode =~ /^([0-9]{6})$/ match == 0 ? true : false end
Tunisia
# File lib/validate_zipcode/regex.rb, line 604 def self.TN(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Turkey
# File lib/validate_zipcode/regex.rb, line 609 def self.TR(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Trinidad and Tobago
# File lib/validate_zipcode/regex.rb, line 599 def self.TT(zipcode) match = zipcode =~ /^([0-9]{6})$/ match == 0 ? true : false end
Ukraine
# File lib/validate_zipcode/regex.rb, line 619 def self.UA(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
United Stade
# File lib/validate_zipcode/regex.rb, line 624 def self.US(zipcode) match = zipcode =~ /^([0-9]{5})$|([0-9]{9})$|([0-9]{5}-[0-9]{4})$/ match == 0 ? true : false end
Uzbekistan
# File lib/validate_zipcode/regex.rb, line 629 def self.UZ(zipcode) match = zipcode =~ /^([0-9]{6})$/ match == 0 ? true : false end
Holy See (Vatican)
# File lib/validate_zipcode/regex.rb, line 264 def self.VA(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Venezuela
# File lib/validate_zipcode/regex.rb, line 634 def self.VE(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Virgin Islands of the United States of America
# File lib/validate_zipcode/regex.rb, line 644 def self.VI(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
Viet Nam
# File lib/validate_zipcode/regex.rb, line 639 def self.VN(zipcode) match = zipcode =~ /^([0-9]{6})$/ match == 0 ? true : false end
Mayotte
# File lib/validate_zipcode/regex.rb, line 429 def self.YT(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end
South Africa
# File lib/validate_zipcode/regex.rb, line 559 def self.ZA(zipcode) match = zipcode =~ /^([0-9]{4})$/ match == 0 ? true : false end
Zambia
# File lib/validate_zipcode/regex.rb, line 649 def self.ZM(zipcode) match = zipcode =~ /^([0-9]{5})$/ match == 0 ? true : false end