6/27/2009

Zip/Postal code validation for France/Italy/Germany and India - Handy RegEx

Zip code validation for any country is most common validation required for any web site where you have address input.
Here is the handy regular expressions, which can be used for Zip/Postal code validation on your web page.

zip code regular expression, postal code regular expression, france, germany, india zip code validation, france, germany, india postal code validation, france, germany, india zip code validation, france, germany, india postal code validation,regex zip code, regex postal code,france, germany, india zip code validation, france, germany, india postal code validation, France, Germany india zip code regex, US and Canada zip code regular expression,German Zip code, German Postal Code, French Zip code, French postal code, Hindi zip code, india post office code
italiano zip code regular expression, postal code regular expression, italiano, Italia, italy, italian, india zip code validation, italy, italian, india postal code validation, italy, italian, india zip code validation, italy, italian, india postal code validation,regex zip code, regex postal code,italy, italian, india zip code validation, italy, italian, india postal code validation, italy, italian india zip code regex, US and Canada zip code regular expression,German Zip code, German Postal Code, French Zip code, French postal code, Hindi zip code, india post office code,Deutsch zip code regular expression, postal code regular expression, france, Deutsch, india zip code validation, france, Deutsch, india postal code validation, france, germany, india zip code validation, france, germany, india postal code validation,regex zip code, regex postal code,france, germany, india zip code validation, france, germany, india postal code validation, Deutsch, France, Germany india zip code regex, US and Canada zip code regular expression,Deutsch Zip code, Deutsch Postal Code, French Zip code, French postal code, Hindi zip code, india post office code


1. France, Italy & Germany all have same format of zip/postal codes therefore the validation of these becomes very simple

For France/Italy/Germany Zip code validation Use below regular Expression, which is also same as zip code validation for US

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



For India Postal code validation Use below regular Expression to validate the zip/postal code in your form.

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



2. If you have a common form for France/Italy/Germany and India Address entry then use below Regular expression, which is going to allow France/Italy/Germany Zip code and India Postal Code in same field.

For France/Italy/Germany zip code & India Postal code validation both in same field use below regular Expression

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



In case you have not observed this, the regular expression for validating both Zip code and Postal code is a OR condition expression combining the two separate regular expressions for US Zip code and Canada Postal code with a pipe (|) separator.


regular expression India france germany us postal code, regular expression validate India france Germany US postal code,regular expression India France Germany US postal code,regular expression India France Germany US zip code,regular expression India France Germany US Zip code
Validate Zip Postal Code using regular expressions, block invalid zip code with regular expression.

2 comments:

  1. If you are looking for US/Canada zip code regular expression then read this US/Canada Zip Code RegEx

    ReplyDelete
  2. RegExp=/[1-9]\d{5}$/ <= INDIA
    RegExp=/[1-9][0-9][0-9][0-9][0-9][0-9]$/ <= INDIA

    ReplyDelete

Got something to say? Don't hold it! Tell it to us.

You Might Like

.....