,

Regex to validate postcodes

Contents


Search by Country

Postcode Regex by Country in alphabetical order:

Austria


[0-9]{4,4}

Australia


[2-9][0-9]{2,3}

Canada


[a-zA-Z].[0-9].[a-zA-Z].\s[0-9].[a-zA-Z].[0-9].

Estonia


[0-9]{5,5}

Germany


[0-9]{5,5}

Italy


[0-9]{5,5}

Netherlands


[0-9]{4,4}\s[a-zA-Z]{2,2}

Portugal


[0-9]{4,4}-[0-9]{3,3}

Sweden


[0-9]{3,3}\s[0-9]{2,2}

File:British_flag.png

UK postcode


United Kingdom

(([A-PR-UW-Z]{1}[A-IK-Y]?)([0-9]?[A-HJKS-UW]?[ABEHMNPRVWXY]?|[0-9]?[0-9]?))\s?([0-9]{1}[ABD-HJLNP-UW-Z]{2})

USA


[0-9]{5,5}[\-]{0,1}[0-9]{4,4}

Comments

21st Jun 10 Thales Jacobi
Common typos relevant to this page - rgex - regexp - regexd - rwgex - r3gex - refex - revex - regexx