Module: ValidateZipcode::Regex

Defined in:
lib/validate_zipcode/regex.rb

Class Method Summary collapse

Class Method Details

.AF(zipcode) ⇒ Object

Afghanistan



4
5
6
7
# File 'lib/validate_zipcode/regex.rb', line 4

def self.AF(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.AL(zipcode) ⇒ Object

Albania



14
15
16
17
# File 'lib/validate_zipcode/regex.rb', line 14

def self.AL(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.AM(zipcode) ⇒ Object

Armenia



34
35
36
37
# File 'lib/validate_zipcode/regex.rb', line 34

def self.AM(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.AR(zipcode) ⇒ Object

Argentina



29
30
31
32
# 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

.AS(zipcode) ⇒ Object

American Samoa



24
25
26
27
# 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

.AT(zipcode) ⇒ Object

Austria



44
45
46
47
# File 'lib/validate_zipcode/regex.rb', line 44

def self.AT(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.AU(zipcode) ⇒ Object

Australia



39
40
41
42
# File 'lib/validate_zipcode/regex.rb', line 39

def self.AU(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.AX(zipcode) ⇒ Object

Aland Islands



9
10
11
12
# File 'lib/validate_zipcode/regex.rb', line 9

def self.AX(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.AZ(zipcode) ⇒ Object

Azerbaijan



49
50
51
52
# File 'lib/validate_zipcode/regex.rb', line 49

def self.AZ(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.BA(zipcode) ⇒ Object

BA Bosnia and Herzegovina



79
80
81
82
# File 'lib/validate_zipcode/regex.rb', line 79

def self.BA(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.BD(zipcode) ⇒ Object

Bangladesh



54
55
56
57
# File 'lib/validate_zipcode/regex.rb', line 54

def self.BD(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.BE(zipcode) ⇒ Object

Belgium



64
65
66
67
# File 'lib/validate_zipcode/regex.rb', line 64

def self.BE(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.BG(zipcode) ⇒ Object

Bulgaria



94
95
96
97
# File 'lib/validate_zipcode/regex.rb', line 94

def self.BG(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.BN(zipcode) ⇒ Object

Brunei Darussalam



89
90
91
92
# 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

.BO(zipcode) ⇒ Object

Bolivia



74
75
76
77
# File 'lib/validate_zipcode/regex.rb', line 74

def self.BO(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.BR(zipcode) ⇒ Object

Brazil



84
85
86
87
# 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

.BT(zipcode) ⇒ Object

Bhutan



69
70
71
72
# File 'lib/validate_zipcode/regex.rb', line 69

def self.BT(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.BY(zipcode) ⇒ Object

Belarus



59
60
61
62
# File 'lib/validate_zipcode/regex.rb', line 59

def self.BY(zipcode)
  match = zipcode =~ /^([0-9]{6})$/
  match == 0 ? true : false
end

.CA(zipcode) ⇒ Object

Canada



109
110
111
112
# 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

.CC(zipcode) ⇒ Object

Cocos (Keeling) Islands



129
130
131
132
# File 'lib/validate_zipcode/regex.rb', line 129

def self.CC(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.CH(zipcode) ⇒ Object

Switzerland



584
585
586
587
# File 'lib/validate_zipcode/regex.rb', line 584

def self.CH(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.CL(zipcode) ⇒ Object

Chile



114
115
116
117
# 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

.CN(zipcode) ⇒ Object

China



119
120
121
122
# File 'lib/validate_zipcode/regex.rb', line 119

def self.CN(zipcode)
  match = zipcode =~ /^([0-9]{6})$/
  match == 0 ? true : false
end

.CO(zipcode) ⇒ Object

Colombia



134
135
136
137
# File 'lib/validate_zipcode/regex.rb', line 134

def self.CO(zipcode)
  match = zipcode =~ /^([0-9]{6})$/
  match == 0 ? true : false
end

.CR(zipcode) ⇒ Object

Costa Rica



139
140
141
142
# File 'lib/validate_zipcode/regex.rb', line 139

def self.CR(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.CS(zipcode) ⇒ Object

Montenegro



459
460
461
462
# File 'lib/validate_zipcode/regex.rb', line 459

def self.CS(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.CU(zipcode) ⇒ Object

Cuba



149
150
151
152
# File 'lib/validate_zipcode/regex.rb', line 149

def self.CU(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.CV(zipcode) ⇒ Object

Cabo Verde



99
100
101
102
# File 'lib/validate_zipcode/regex.rb', line 99

def self.CV(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.CX(zipcode) ⇒ Object

Christmas Island



124
125
126
127
# File 'lib/validate_zipcode/regex.rb', line 124

def self.CX(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.CY(zipcode) ⇒ Object

Cyprus



154
155
156
157
# File 'lib/validate_zipcode/regex.rb', line 154

def self.CY(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.CZ(zipcode) ⇒ Object

Czech Republic



159
160
161
162
# 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

.DE(zipcode) ⇒ Object

Deutsch or Germany



169
170
171
172
# File 'lib/validate_zipcode/regex.rb', line 169

def self.DE(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.DK(zipcode) ⇒ Object

Denmark



164
165
166
167
# File 'lib/validate_zipcode/regex.rb', line 164

def self.DK(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.DO(zipcode) ⇒ Object

Dominican Republic



174
175
176
177
# File 'lib/validate_zipcode/regex.rb', line 174

def self.DO(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.DZ(zipcode) ⇒ Object

Algeria



19
20
21
22
# File 'lib/validate_zipcode/regex.rb', line 19

def self.DZ(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.EC(zipcode) ⇒ Object

Ecuador



179
180
181
182
# File 'lib/validate_zipcode/regex.rb', line 179

def self.EC(zipcode)
  match = zipcode =~ /^([0-9]{6})$/
  match == 0 ? true : false
end

.EE(zipcode) ⇒ Object

Estonia



194
195
196
197
# File 'lib/validate_zipcode/regex.rb', line 194

def self.EE(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.EG(zipcode) ⇒ Object

Egypt



184
185
186
187
# File 'lib/validate_zipcode/regex.rb', line 184

def self.EG(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.ES(zipcode) ⇒ Object

Spain



564
565
566
567
# File 'lib/validate_zipcode/regex.rb', line 564

def self.ES(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.ET(zipcode) ⇒ Object

Ethiopia



199
200
201
202
# File 'lib/validate_zipcode/regex.rb', line 199

def self.ET(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.FI(zipcode) ⇒ Object

Finland



204
205
206
207
# File 'lib/validate_zipcode/regex.rb', line 204

def self.FI(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.FM(zipcode) ⇒ Object

Federated States of Micronesia



439
440
441
442
# File 'lib/validate_zipcode/regex.rb', line 439

def self.FM(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.FR(zipcode) ⇒ Object

France



209
210
211
212
# File 'lib/validate_zipcode/regex.rb', line 209

def self.FR(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.GE(zipcode) ⇒ Object

Georgia



224
225
226
227
# File 'lib/validate_zipcode/regex.rb', line 224

def self.GE(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.GF(zipcode) ⇒ Object

French Guiana



214
215
216
217
# File 'lib/validate_zipcode/regex.rb', line 214

def self.GF(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.GL(zipcode) ⇒ Object

Greenland



234
235
236
237
# File 'lib/validate_zipcode/regex.rb', line 234

def self.GL(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.GP(zipcode) ⇒ Object

Guadeloupe



239
240
241
242
# File 'lib/validate_zipcode/regex.rb', line 239

def self.GP(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.GR(zipcode) ⇒ Object

Greece



229
230
231
232
# 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

.GT(zipcode) ⇒ Object

Guatemala



244
245
246
247
# File 'lib/validate_zipcode/regex.rb', line 244

def self.GT(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.GW(zipcode) ⇒ Object

Guinea-Bissau



249
250
251
252
# File 'lib/validate_zipcode/regex.rb', line 249

def self.GW(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.HM(zipcode) ⇒ Object

Heard Island and McDonald Islands



259
260
261
262
# File 'lib/validate_zipcode/regex.rb', line 259

def self.HM(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.HN(zipcode) ⇒ Object

Honduras



269
270
271
272
# 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

.HR(zipcode) ⇒ Object

Croatia



144
145
146
147
# File 'lib/validate_zipcode/regex.rb', line 144

def self.HR(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.HT(zipcode) ⇒ Object

Haiti



254
255
256
257
# 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

.HU(zipcode) ⇒ Object

Hungary



274
275
276
277
# File 'lib/validate_zipcode/regex.rb', line 274

def self.HU(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.ID(zipcode) ⇒ Object

Indonesia



289
290
291
292
# File 'lib/validate_zipcode/regex.rb', line 289

def self.ID(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.IL(zipcode) ⇒ Object

Israel



304
305
306
307
# File 'lib/validate_zipcode/regex.rb', line 304

def self.IL(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.IN(zipcode) ⇒ Object

India



284
285
286
287
# File 'lib/validate_zipcode/regex.rb', line 284

def self.IN(zipcode)
  match = zipcode =~ /^([0-9]{6})$/
  match == 0 ? true : false
end

.IQ(zipcode) ⇒ Object

Iraq



299
300
301
302
# File 'lib/validate_zipcode/regex.rb', line 299

def self.IQ(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.IR(zipcode) ⇒ Object

Iran



294
295
296
297
# File 'lib/validate_zipcode/regex.rb', line 294

def self.IR(zipcode)
  match = zipcode =~ /^([0-9]{10})$/
  match == 0 ? true : false
end

.IS(zipcode) ⇒ Object

Iceland



279
280
281
282
# File 'lib/validate_zipcode/regex.rb', line 279

def self.IS(zipcode)
  match = zipcode =~ /^([0-9]{3})$/
  match == 0 ? true : false
end

.IT(zipcode) ⇒ Object

Italy



309
310
311
312
# File 'lib/validate_zipcode/regex.rb', line 309

def self.IT(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.JO(zipcode) ⇒ Object

Jordan



319
320
321
322
# File 'lib/validate_zipcode/regex.rb', line 319

def self.JO(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.JP(zipcode) ⇒ Object

Japan



314
315
316
317
# 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

.KE(zipcode) ⇒ Object

Kenya



329
330
331
332
# File 'lib/validate_zipcode/regex.rb', line 329

def self.KE(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.KG(zipcode) ⇒ Object

Kyrgyzstan



344
345
346
347
# File 'lib/validate_zipcode/regex.rb', line 344

def self.KG(zipcode)
  match = zipcode =~ /^([0-9]{6})$/
  match == 0 ? true : false
end

.KH(zipcode) ⇒ Object

Cambodia



104
105
106
107
# File 'lib/validate_zipcode/regex.rb', line 104

def self.KH(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : fals
end

.KR(zipcode) ⇒ Object

KR - Republic of Korea



334
335
336
337
# File 'lib/validate_zipcode/regex.rb', line 334

def self.KR(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.KW(zipcode) ⇒ Object

Kuwait



339
340
341
342
# File 'lib/validate_zipcode/regex.rb', line 339

def self.KW(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.KZ(zipcode) ⇒ Object

Kazakhstan



324
325
326
327
# File 'lib/validate_zipcode/regex.rb', line 324

def self.KZ(zipcode)
  match = zipcode =~ /^([0-9]{6})$/
  match == 0 ? true : false
end

.LA(zipcode) ⇒ Object

Laos



349
350
351
352
# File 'lib/validate_zipcode/regex.rb', line 349

def self.LA(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.LB(zipcode) ⇒ Object

Lebanon



359
360
361
362
# 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

.LI(zipcode) ⇒ Object

Liechtenstein



374
375
376
377
# File 'lib/validate_zipcode/regex.rb', line 374

def self.LI(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.LK(zipcode) ⇒ Object

Sri Lanka



569
570
571
572
# File 'lib/validate_zipcode/regex.rb', line 569

def self.LK(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.LR(zipcode) ⇒ Object

Liberia



369
370
371
372
# File 'lib/validate_zipcode/regex.rb', line 369

def self.LR(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.LS(zipcode) ⇒ Object

Lesotho



364
365
366
367
# File 'lib/validate_zipcode/regex.rb', line 364

def self.LS(zipcode)
  match = zipcode =~ /^([0-9]{3})$/
  match == 0 ? true : false
end

.LT(zipcode) ⇒ Object

Lithuania



379
380
381
382
# File 'lib/validate_zipcode/regex.rb', line 379

def self.LT(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.LU(zipcode) ⇒ Object

Luxembourg



384
385
386
387
# File 'lib/validate_zipcode/regex.rb', line 384

def self.LU(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.LV(zipcode) ⇒ Object

Latvia



354
355
356
357
# File 'lib/validate_zipcode/regex.rb', line 354

def self.LV(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.MA(zipcode) ⇒ Object

Morocco



469
470
471
472
# File 'lib/validate_zipcode/regex.rb', line 469

def self.MA(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.MC(zipcode) ⇒ Object

Monaco



449
450
451
452
# File 'lib/validate_zipcode/regex.rb', line 449

def self.MC(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.MD(zipcode) ⇒ Object

Republic of Moldova



444
445
446
447
# File 'lib/validate_zipcode/regex.rb', line 444

def self.MD(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.MG(zipcode) ⇒ Object

Madagascar



394
395
396
397
# File 'lib/validate_zipcode/regex.rb', line 394

def self.MG(zipcode)
  match = zipcode =~ /^([0-9]{3})$/
  match == 0 ? true : false
end

.MH(zipcode) ⇒ Object

Marshall Islands



414
415
416
417
# File 'lib/validate_zipcode/regex.rb', line 414

def self.MH(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.MK(zipcode) ⇒ Object

Macedonia



389
390
391
392
# File 'lib/validate_zipcode/regex.rb', line 389

def self.MK(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.MM(zipcode) ⇒ Object

Myanmar



479
480
481
482
# File 'lib/validate_zipcode/regex.rb', line 479

def self.MM(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.MN(zipcode) ⇒ Object

Mongolia



454
455
456
457
# File 'lib/validate_zipcode/regex.rb', line 454

def self.MN(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.MQ(zipcode) ⇒ Object

Martinique



419
420
421
422
# File 'lib/validate_zipcode/regex.rb', line 419

def self.MQ(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.MS(zipcode) ⇒ Object

Montserrat



464
465
466
467
# 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

.MT(zipcode) ⇒ Object

Malta



409
410
411
412
# 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

.MU(zipcode) ⇒ Object

Mauritius



424
425
426
427
# File 'lib/validate_zipcode/regex.rb', line 424

def self.MU(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.MV(zipcode) ⇒ Object

Maldives



404
405
406
407
# File 'lib/validate_zipcode/regex.rb', line 404

def self.MV(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.MX(zipcode) ⇒ Object

Mexico



434
435
436
437
# File 'lib/validate_zipcode/regex.rb', line 434

def self.MX(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.MY(zipcode) ⇒ Object

Malaysia



399
400
401
402
# File 'lib/validate_zipcode/regex.rb', line 399

def self.MY(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.MZ(zipcode) ⇒ Object

Mozambique



474
475
476
477
# File 'lib/validate_zipcode/regex.rb', line 474

def self.MZ(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.NA(zipcode) ⇒ Object

Namibia



484
485
486
487
# File 'lib/validate_zipcode/regex.rb', line 484

def self.NA(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.NE(zipcode) ⇒ Object

Niger



494
495
496
497
# File 'lib/validate_zipcode/regex.rb', line 494

def self.NE(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.NO(zipcode) ⇒ Object

Norway



504
505
506
507
# File 'lib/validate_zipcode/regex.rb', line 504

def self.NO(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.NP(zipcode) ⇒ Object

Nepal



489
490
491
492
# File 'lib/validate_zipcode/regex.rb', line 489

def self.NP(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.NZ(zipcode) ⇒ Object

New Zealand (including the Ross dependency)



499
500
501
502
# File 'lib/validate_zipcode/regex.rb', line 499

def self.NZ(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.PE(zipcode) ⇒ Object

Peru



514
515
516
517
# File 'lib/validate_zipcode/regex.rb', line 514

def self.PE(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.PF(zipcode) ⇒ Object

French Polynesia



219
220
221
222
# File 'lib/validate_zipcode/regex.rb', line 219

def self.PF(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.PH(zipcode) ⇒ Object

Philippines



519
520
521
522
# File 'lib/validate_zipcode/regex.rb', line 519

def self.PH(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.PT(zipcode) ⇒ Object

Portugal



524
525
526
527
# 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

.PY(zipcode) ⇒ Object

Paraguay



509
510
511
512
# File 'lib/validate_zipcode/regex.rb', line 509

def self.PY(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.RO(zipcode) ⇒ Object

Romania



529
530
531
532
# File 'lib/validate_zipcode/regex.rb', line 529

def self.RO(zipcode)
  match = zipcode =~ /^([0-9]{6})$/
  match == 0 ? true : false
end

.RU(zipcode) ⇒ Object

Russian



534
535
536
537
# File 'lib/validate_zipcode/regex.rb', line 534

def self.RU(zipcode)
  match = zipcode =~ /^([0-9]{6})$/
  match == 0 ? true : false
end

.SA(zipcode) ⇒ Object

Saudi Arabia



539
540
541
542
# File 'lib/validate_zipcode/regex.rb', line 539

def self.SA(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.SD(zipcode) ⇒ Object

Sudan



574
575
576
577
# File 'lib/validate_zipcode/regex.rb', line 574

def self.SD(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.SG(zipcode) ⇒ Object

Singapore



549
550
551
552
# File 'lib/validate_zipcode/regex.rb', line 549

def self.SG(zipcode)
  match = zipcode =~ /^([0-9]{6})$/
  match == 0 ? true : false
end

.SI(zipcode) ⇒ Object

Slovenia



554
555
556
557
# File 'lib/validate_zipcode/regex.rb', line 554

def self.SI(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.SJ(zipcode) ⇒ Object

Svalbard and Jan Mayen Island



579
580
581
582
# File 'lib/validate_zipcode/regex.rb', line 579

def self.SJ(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.SN(zipcode) ⇒ Object

Senegal



544
545
546
547
# File 'lib/validate_zipcode/regex.rb', line 544

def self.SN(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.SV(zipcode) ⇒ Object

El Salvador



189
190
191
192
# File 'lib/validate_zipcode/regex.rb', line 189

def self.SV(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.TH(zipcode) ⇒ Object

Thailand



594
595
596
597
# File 'lib/validate_zipcode/regex.rb', line 594

def self.TH(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.TJ(zipcode) ⇒ Object

Tajikistan



589
590
591
592
# File 'lib/validate_zipcode/regex.rb', line 589

def self.TJ(zipcode)
  match = zipcode =~ /^([0-9]{6})$/
  match == 0 ? true : false
end

.TM(zipcode) ⇒ Object

Turkmenistan



614
615
616
617
# File 'lib/validate_zipcode/regex.rb', line 614

def self.TM(zipcode)
  match = zipcode =~ /^([0-9]{6})$/
  match == 0 ? true : false
end

.TN(zipcode) ⇒ Object

Tunisia



604
605
606
607
# File 'lib/validate_zipcode/regex.rb', line 604

def self.TN(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.TR(zipcode) ⇒ Object

Turkey



609
610
611
612
# File 'lib/validate_zipcode/regex.rb', line 609

def self.TR(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.TT(zipcode) ⇒ Object

Trinidad and Tobago



599
600
601
602
# File 'lib/validate_zipcode/regex.rb', line 599

def self.TT(zipcode)
  match = zipcode =~ /^([0-9]{6})$/
  match == 0 ? true : false
end

.UA(zipcode) ⇒ Object

Ukraine



619
620
621
622
# File 'lib/validate_zipcode/regex.rb', line 619

def self.UA(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.US(zipcode) ⇒ Object

United Stade



624
625
626
627
# 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

.UZ(zipcode) ⇒ Object

Uzbekistan



629
630
631
632
# File 'lib/validate_zipcode/regex.rb', line 629

def self.UZ(zipcode)
  match = zipcode =~ /^([0-9]{6})$/
  match == 0 ? true : false
end

.VA(zipcode) ⇒ Object

Holy See (Vatican)



264
265
266
267
# File 'lib/validate_zipcode/regex.rb', line 264

def self.VA(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.VE(zipcode) ⇒ Object

Venezuela



634
635
636
637
# File 'lib/validate_zipcode/regex.rb', line 634

def self.VE(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.VI(zipcode) ⇒ Object

Virgin Islands of the United States of America



644
645
646
647
# File 'lib/validate_zipcode/regex.rb', line 644

def self.VI(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.VN(zipcode) ⇒ Object

Viet Nam



639
640
641
642
# File 'lib/validate_zipcode/regex.rb', line 639

def self.VN(zipcode)
  match = zipcode =~ /^([0-9]{6})$/
  match == 0 ? true : false
end

.YT(zipcode) ⇒ Object

Mayotte



429
430
431
432
# File 'lib/validate_zipcode/regex.rb', line 429

def self.YT(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end

.ZA(zipcode) ⇒ Object

South Africa



559
560
561
562
# File 'lib/validate_zipcode/regex.rb', line 559

def self.ZA(zipcode)
  match = zipcode =~ /^([0-9]{4})$/
  match == 0 ? true : false
end

.ZM(zipcode) ⇒ Object

Zambia



649
650
651
652
# File 'lib/validate_zipcode/regex.rb', line 649

def self.ZM(zipcode)
  match = zipcode =~ /^([0-9]{5})$/
  match == 0 ? true : false
end