Could you please support Indian postal codes too.

Regular expression - ([0-9]{6}|[0-9]{3}\s[0-9]{3})
which will validate postal codes like - 360311 | 360 311 | 360 001

or for simple validation:

^([0-9]{6})$

I am no way a coder so am unable to write a patch.

Comments

jeremyclassic’s picture

Assigned: Unassigned » jeremyclassic
Status: Active » Closed (fixed)

Added regex to postal_code_regexes.inc

khanz’s picture

Status: Closed (fixed) » Active

Just now I came to know that Indian Postal codes (PIN No) start from '1' instead of '0' as mentioned on Indian Post's official site. I guess the regex code should be changed to.. ([1-9]{6}|[1-9]{3}\s[1-9]{3}).

BTW thank you for committing it so soon :).

jeremyclassic’s picture

Status: Active » Closed (fixed)

That regex would not work for the Central Delhi postal code of 110001. Please refer to http://www.indiapost.gov.in/Pin/ . I have updated the regex to be a bit more flexible: ([1-9][0-9]{2}\s?[0-9]{3})