.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Regexp::Common::zip 3pm" .TH Regexp::Common::zip 3pm "2017-06-17" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Regexp::Common::zip \-\- provide regexes for postal codes. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Regexp::Common qw /zip/; \& \& while (<>) { \& /^$RE{zip}{Netherlands}$/ and print "Dutch postal code\en"; \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Please consult the manual of Regexp::Common for a general description of the works of this interface. .PP Do not use this module directly, but load it via \fIRegexp::Common\fR. .PP This module offers patterns for zip or postal codes of many different countries. They all have the form \f(CW\*(C`$RE{zip}{Country}[{options}]\*(C'\fR. .PP The following common options are used: .ie n .SS """{\-prefix=[yes|no|allow]}"" and ""{\-country=PAT}""." .el .SS "\f(CW{\-prefix=[yes|no|allow]}\fP and \f(CW{\-country=PAT}\fP." .IX Subsection "{-prefix=[yes|no|allow]} and {-country=PAT}." Postal codes can be prefixed with a country abbreviation. That is, a Dutch postal code of \fB1234 \s-1AB\s0\fR can also be written as \fB\s-1NL\-1234 AB\s0\fR. By default, all the patterns will allow the prefixes. But this can be changed with the \f(CW\*(C`\-prefix\*(C'\fR option. With \f(CW\*(C`\-prefix=yes\*(C'\fR, the returned pattern requires a country prefix, while \f(CW\*(C`\-prefix=no\*(C'\fR disallows a prefix. Any argument that doesn't start with a \f(CW\*(C`y\*(C'\fR or a \f(CW\*(C`n\*(C'\fR allows a country prefix, but doesn't require them. .PP The prefixes used are, unfortunately, not always the same. Officially, \&\s-1ISO\s0 country codes need to be used, but the usage of \fI\s-1CEPT\s0\fR codes (the same ones as used on cars) is common too. By default, each postal code will recognize a country prefix that's either the \s-1ISO\s0 standard or the \&\s-1CEPT\s0 code. That is, German postal codes may prefixed with either \f(CW\*(C`DE\*(C'\fR or \f(CW\*(C`D\*(C'\fR. The recognized prefix can be changed with the \f(CW\*(C`\-country\*(C'\fR option, which takes a (sub)pattern as argument. The arguments \f(CW\*(C`iso\*(C'\fR and \f(CW\*(C`cept\*(C'\fR are special, and indicate the language prefix should be the \&\s-1ISO\s0 country code, or the \s-1CEPT\s0 code. .PP Examples: /$RE{zip}{Netherlands}/; # Matches '1234 \s-1AB\s0' and '\s-1NL\-1234 AB\s0'. /$RE{zip}{Netherlands}{\-prefix => 'no'}/; # Matches '1234 \s-1AB\s0' but not '\s-1NL\-1234 AB\s0'. /$RE{zip}{Netherlands}{\-prefix => 'yes'}/; # Matches '\s-1NL\-1234 AB\s0' but not '1234 \s-1AB\s0'. .PP .Vb 8 \& /$RE{zip}{Germany}/; \& # Matches \*(AqDE\-12345\*(Aq and \*(AqD\-12345\*(Aq. \& /$RE{zip}{Germany}{\-country => \*(Aqiso\*(Aq}/; \& # Matches \*(AqDE\-12345\*(Aq but not \*(AqD\-12345\*(Aq. \& /$RE{zip}{Germany}{\-country => \*(Aqcept\*(Aq}/; \& # Matches \*(AqD\-12345\*(Aq but not \*(AqDE\-12345\*(Aq. \& /$RE{zip}{Germany}{\-country => \*(AqGER\*(Aq}/; \& # Matches \*(AqGER\-12345\*(Aq. .Ve .ie n .SS """{\-sep=PAT}""" .el .SS "\f(CW{\-sep=PAT}\fP" .IX Subsection "{-sep=PAT}" Some countries have postal codes that consist of two parts. Typically there is an official way of separating those parts; but in practise people tend to use different separators. For instance, if the official way to separate parts is to use a space, it happens that the space is left off. The \f(CW\*(C`\-sep\*(C'\fR option can be given a pattern as argument which indicates what to use as a separator between the parts. .PP Examples: /$RE{zip}{Netherlands}/; # Matches '1234 \s-1AB\s0' but not '1234AB'. /$RE{zip}{Netherlands}{\-sep => '\es*'}/; # Matches '1234 \s-1AB\s0' and '1234AB'. .ie n .SS "$RE{zip}{Australia}{\-lax}" .el .SS "\f(CW$RE{zip}{Australia}{\-lax}\fP" .IX Subsection "$RE{zip}{Australia}{-lax}" Returns a pattern that recognizes Australian postal codes. Australian postal codes consist of four digits; the first two digits, which range from '10' to '97', indicate the state, although there are exceptions. Territories use '02' or '08' as starting digits. '0909' is the only postal code starting with '09' \- this is the postal code for the Northern Territory University). The (optional) country prefixes are \fI\s-1AU\s0\fR (\s-1ISO\s0 country code) and \fI\s-1AUS\s0\fR (\s-1CEPT\s0 code). .PP It the past, it was claimed that for postal codes starting with a 0, the leading 0 may be omitted, and up to (and including) version 2016060201, the leading 0 was optional. But there doesn't seem be solid evidence the leading 0 is optional. So, we now require there always to be four digit \*(-- unless the \f(CW\*(C`{\-lax}\*(C'\fR option is given, then a possibly leading 0 is optional. .PP Regexp::Common 2.107 and before used \f(CW$RE{zip}{Australian}\fR. This is still supported. .PP If \f(CW\*(C`{\-keep}\*(C'\fR is used, the following variables will be set: .ie n .IP "$1" 4 .el .IP "\f(CW$1\fR" 4 .IX Item "$1" The entire postal code. .ie n .IP "$2" 4 .el .IP "\f(CW$2\fR" 4 .IX Item "$2" The country code prefix. .ie n .IP "$3" 4 .el .IP "\f(CW$3\fR" 4 .IX Item "$3" The postal code without the country prefix. .PP As of version 2016060201, no \f(CW$4\fR or \f(CW$5\fR will be set. .ie n .SS """$RE {zip} {Austria}""" .el .SS "\f(CW$RE {zip} {Austria}\fP" .IX Subsection "$RE {zip} {Austria}" Returns a pattern which recognizes Austrian postal codes. Austrian postal codes consists of 4 digits, but not all possibilities are used. This pattern matches the postal codes in use. The (optional) country prefixes are \fI\s-1AT\s0\fR (\s-1ISO\s0 country code) and \fI\s-1AUT\s0\fR (\s-1CEPT\s0 code). .PP If \f(CW\*(C`{\-keep}\*(C'\fR is used, the following variables will be set: .ie n .IP "$1" 4 .el .IP "\f(CW$1\fR" 4 .IX Item "$1" The entire postal code. .ie n .IP "$2" 4 .el .IP "\f(CW$2\fR" 4 .IX Item "$2" The country code prefix. .ie n .IP "$3" 4 .el .IP "\f(CW$3\fR" 4 .IX Item "$3" The postal code without the country code prefix. .ie n .SS "$RE{zip}{Belgium}" .el .SS "\f(CW$RE{zip}{Belgium}\fP" .IX Subsection "$RE{zip}{Belgium}" Returns a pattern than recognizes Belgian postal codes. Belgian postal codes consist of 4 digits, of which the first indicates the province. The (optional) country prefixes are \fI\s-1BE\s0\fR (\s-1ISO\s0 country code) and \&\fIB\fR (\s-1CEPT\s0 code). .PP If \f(CW\*(C`{\-keep}\*(C'\fR is used, the following variables will be set: .ie n .IP "$1" 4 .el .IP "\f(CW$1\fR" 4 .IX Item "$1" The entire postal code. .ie n .IP "$2" 4 .el .IP "\f(CW$2\fR" 4 .IX Item "$2" The country code prefix. .ie n .IP "$3" 4 .el .IP "\f(CW$3\fR" 4 .IX Item "$3" The postal code without the country prefix. .ie n .SS "$RE{zip}{Denmark}" .el .SS "\f(CW$RE{zip}{Denmark}\fP" .IX Subsection "$RE{zip}{Denmark}" Returns a pattern that recognizes Danish postal codes. Danish postal codes consist of four numbers; the first digit indicates the distribution region, the second the distribution district. The (optional) country prefix is \fI\s-1DK\s0\fR, which is both the \s-1ISO\s0 country code and the \s-1CEPT\s0 code. .PP If \f(CW\*(C`{\-keep}\*(C'\fR is used, the following variables will be set: .ie n .IP "$1" 4 .el .IP "\f(CW$1\fR" 4 .IX Item "$1" The entire postal code. .ie n .IP "$2" 4 .el .IP "\f(CW$2\fR" 4 .IX Item "$2" The country code prefix. .ie n .IP "$3" 4 .el .IP "\f(CW$3\fR" 4 .IX Item "$3" The postal code without the country prefix. .PP Danish postal codes will not start with 39. Postal codes of the form 39XX are reserved from Greenland; the pattern for Danish postal codes will not recognize them. .ie n .SS "$RE{zip}{France}" .el .SS "\f(CW$RE{zip}{France}\fP" .IX Subsection "$RE{zip}{France}" Returns a pattern that recognizes French postal codes. French postal codes consist of five numbers; the first two numbers, which range from '01' to '98', indicate the department. The (optional) country prefixes are \fI\s-1FR\s0\fR (\s-1ISO\s0 country code) and \fIF\fR (\s-1CEPT\s0 code). Regexp::Common 2.107 and before used \f(CW$RE{zip}{French}\fR. This is still supported. .PP Monaco uses postal codes which are part of the numbering system used by the French postal code system; their numbers start with 980. These numbers are \f(CW\*(C`not\*(C'\fR recognized by this pattern. .PP If \f(CW\*(C`{\-keep}\*(C'\fR is used, the following variables will be set: .ie n .IP "$1" 4 .el .IP "\f(CW$1\fR" 4 .IX Item "$1" The entire postal code. .ie n .IP "$2" 4 .el .IP "\f(CW$2\fR" 4 .IX Item "$2" The country code prefix. .ie n .IP "$3" 4 .el .IP "\f(CW$3\fR" 4 .IX Item "$3" The postal code without the country prefix. .ie n .SS "$RE{zip}{Germany}" .el .SS "\f(CW$RE{zip}{Germany}\fP" .IX Subsection "$RE{zip}{Germany}" Returns a pattern that recognizes German postal codes. German postal codes consist of five numbers; the first two numbers indicating a wider postal area, the last three digits a postal district. The (optional) country prefixes are \fI\s-1DE\s0\fR (\s-1ISO\s0 country code) and \&\fID\fR (\s-1CEPT\s0 code). Regexp::Common 2.107 and before used \f(CW$RE{zip}{German}\fR. This is still supported. .PP If \f(CW\*(C`{\-keep}\*(C'\fR is used, the following variables will be set: .ie n .IP "$1" 4 .el .IP "\f(CW$1\fR" 4 .IX Item "$1" The entire postal code. .ie n .IP "$2" 4 .el .IP "\f(CW$2\fR" 4 .IX Item "$2" The country code prefix. .ie n .IP "$3" 4 .el .IP "\f(CW$3\fR" 4 .IX Item "$3" The postal code without the country prefix. .ie n .SS "$RE{zip}{Greenland}" .el .SS "\f(CW$RE{zip}{Greenland}\fP" .IX Subsection "$RE{zip}{Greenland}" Returns a pattern that recognizes postal codes from Greenland. Greenland, uses the Danish postal codes system. Postal codes starting with 39 are reserved for Greenland, and all Greenlandic postal codes start with 39. Except the postal code for Santa. He uses 2412. .PP The (optional) country prefix is \fI\s-1GL\s0\fR, which is use both as the \s-1ISO\s0 country code and the \s-1CEPT\s0 code. Earlier versions used \&\fI\s-1DK\s0\fR as the prefix. .PP If \f(CW\*(C`{\-keep}\*(C'\fR is used, the following variables will be set: .ie n .IP "$1" 4 .el .IP "\f(CW$1\fR" 4 .IX Item "$1" The entire postal code. .ie n .IP "$2" 4 .el .IP "\f(CW$2\fR" 4 .IX Item "$2" The country code prefix. .ie n .IP "$3" 4 .el .IP "\f(CW$3\fR" 4 .IX Item "$3" The postal code without the country prefix. .ie n .SS "$RE{zip}{Italy}" .el .SS "\f(CW$RE{zip}{Italy}\fP" .IX Subsection "$RE{zip}{Italy}" Returns a pattern recognizing Italian postal codes. Italian postal codes consist of 5 digits. The first digit indicates the region, the second the province. The third digit is odd for province capitals, and even for the province itself. The fourth digit indicates the route, and the fifth a place on the route (0 for small places, alphabetically for the rest). .PP Codes starting with 4789 are postal codes for San Marino; they are not recognized by the pattern. Use \f(CW\*(C`$RE {zip} {\*(AqSan Marino\*(Aq}\*(C'\fR instead. .PP The country prefix is either \fI\s-1IT\s0\fR (the \s-1ISO\s0 country code), or \&\fII\fR (the \s-1CEPT\s0 code). .PP If \f(CW\*(C`{\-keep}\*(C'\fR is used, the following variables will be set: .ie n .IP "$1" 4 .el .IP "\f(CW$1\fR" 4 .IX Item "$1" The entire postal code. .ie n .IP "$2" 4 .el .IP "\f(CW$2\fR" 4 .IX Item "$2" The country code prefix. .ie n .IP "$3" 4 .el .IP "\f(CW$3\fR" 4 .IX Item "$3" The postal code without the country prefix. .ie n .SS """$RE {zip} {Liechtenstein}""" .el .SS "\f(CW$RE {zip} {Liechtenstein}\fP" .IX Subsection "$RE {zip} {Liechtenstein}" Returns a pattern which recognizes postal codes used in Liechtenstein. Liechtenstein uses postal codes from the Swiss postal code system. This system uses four digits. Postal codes which start with 94, and use 8 or 9 as a third digit are postal codes for Liechtenstein. .PP If \f(CW\*(C`{\-keep}\*(C'\fR is used, the following variables will be set: .ie n .IP "$1" 4 .el .IP "\f(CW$1\fR" 4 .IX Item "$1" The entire postal code. .ie n .IP "$2" 4 .el .IP "\f(CW$2\fR" 4 .IX Item "$2" The country code prefix. .ie n .IP "$3" 4 .el .IP "\f(CW$3\fR" 4 .IX Item "$3" The postal code without the country prefix. .PP The \s-1ISO\s0 country prefix is \fI\s-1LI\s0\fR, the \s-1CEPT\s0 country prefix is \fI\s-1LIE\s0\fR. .ie n .SS """$RE {zip {Monaco}""" .el .SS "\f(CW$RE {zip {Monaco}\fP" .IX Subsection "$RE {zip {Monaco}" Returns a pattern for postal codes used in Monaco. Monaco uses a range from the system used in France. They are 5 digits, starting with \fI980\fR. The number \fI98000\fR is used for physical addresses. Numbers ending in \f(CW01\fR to \f(CW99\fR are used for special deliveries. .PP The \s-1ISO\s0 country code is \fI\s-1MC\s0\fR. .PP If \f(CW\*(C`{\-keep}\*(C'\fR is used, the following variables will be set: .ie n .IP "$1" 4 .el .IP "\f(CW$1\fR" 4 .IX Item "$1" The entire postal code. .ie n .IP "$2" 4 .el .IP "\f(CW$2\fR" 4 .IX Item "$2" The country code prefix. .ie n .IP "$3" 4 .el .IP "\f(CW$3\fR" 4 .IX Item "$3" The postal code without the country prefix. .ie n .SS "$RE{zip}{Netherlands}" .el .SS "\f(CW$RE{zip}{Netherlands}\fP" .IX Subsection "$RE{zip}{Netherlands}" Returns a pattern that recognizes Dutch postal codes. Dutch postal codes consist of 4 digits and 2 letters, separated by a space. The separator can be changed using the \f(CW\*(C`{\-sep}\*(C'\fR option, as discussed above. The (optional) country prefix is \fI\s-1NL\s0\fR, which is both the \&\s-1ISO\s0 country code and the \s-1CEPT\s0 code. Regexp::Common 2.107 and earlier used \f(CW$RE{zip}{Dutch}\fR. This is still supported. .PP If \f(CW\*(C`{\-keep}\*(C'\fR is used, the following variables will be set: .ie n .IP "$1" 4 .el .IP "\f(CW$1\fR" 4 .IX Item "$1" The entire postal code. .ie n .IP "$2" 4 .el .IP "\f(CW$2\fR" 4 .IX Item "$2" The country code prefix. .ie n .IP "$3" 4 .el .IP "\f(CW$3\fR" 4 .IX Item "$3" The postal code without the country prefix. .ie n .IP "$4" 4 .el .IP "\f(CW$4\fR" 4 .IX Item "$4" The digits part of the postal code. .ie n .IP "$5" 4 .el .IP "\f(CW$5\fR" 4 .IX Item "$5" The separator between the digits and the letters. .ie n .IP "$6" 4 .el .IP "\f(CW$6\fR" 4 .IX Item "$6" The letters part of the postal code. .ie n .SS "$RE{zip}{Norway}" .el .SS "\f(CW$RE{zip}{Norway}\fP" .IX Subsection "$RE{zip}{Norway}" Returns a pattern that recognizes Norwegian postal codes. Norwegian postal codes consist of four digits. .PP The country prefix is either \fI\s-1NO\s0\fR (the \s-1ISO\s0 country code), or \&\fIN\fR (the \s-1CEPT\s0 code). .PP If \f(CW\*(C`{\-keep}\*(C'\fR is used, the following variables will be set: .ie n .IP "$1" 4 .el .IP "\f(CW$1\fR" 4 .IX Item "$1" The entire postal code. .ie n .IP "$2" 4 .el .IP "\f(CW$2\fR" 4 .IX Item "$2" The country code prefix. .ie n .IP "$3" 4 .el .IP "\f(CW$3\fR" 4 .IX Item "$3" The postal code without the country prefix. .ie n .SS """$RE {zip} {\*(AqSan Marino\*(Aq}""" .el .SS "\f(CW$RE {zip} {\*(AqSan Marino\*(Aq}\fP" .IX Subsection "$RE {zip} {San Marino}" Postal codes of San Marino use a slice from the Italian postal codes. Any code starting 4789, followed by another digit belongs to San Marino. .PP The country prefix for San Marino is \fI\s-1SM\s0\fR. .PP If \f(CW\*(C`{\-keep}\*(C'\fR is used, the following variables will be set: .ie n .IP "$1" 4 .el .IP "\f(CW$1\fR" 4 .IX Item "$1" The entire postal code. .ie n .IP "$2" 4 .el .IP "\f(CW$2\fR" 4 .IX Item "$2" The country code prefix. .ie n .IP "$3" 4 .el .IP "\f(CW$3\fR" 4 .IX Item "$3" The postal code without the country prefix. .ie n .SS "$RE{zip}{Spain}" .el .SS "\f(CW$RE{zip}{Spain}\fP" .IX Subsection "$RE{zip}{Spain}" Returns a pattern that recognizes Spanish postal codes. Spanish postal codes consist of 5 digits. The first 2 indicate one of Spain's fifties provinces (in alphabetical order), starting with \f(CW00\fR. The third digit indicates a main city or the main delivery rounds. The last two digits are the delivery area, secondary delivery route or a link to rural areas. .PP The country prefix is either \fI\s-1ES\s0\fR (the \s-1ISO\s0 country code), or \&\fIE\fR (the \s-1CEPT\s0 code). .PP If \f(CW\*(C`{\-keep}\*(C'\fR is used, the following variables will be set: .ie n .IP "$1" 4 .el .IP "\f(CW$1\fR" 4 .IX Item "$1" The entire postal code. .ie n .IP "$2" 4 .el .IP "\f(CW$2\fR" 4 .IX Item "$2" The country code prefix. .ie n .IP "$3" 4 .el .IP "\f(CW$3\fR" 4 .IX Item "$3" The postal code without the country prefix. .ie n .IP "$4" 4 .el .IP "\f(CW$4\fR" 4 .IX Item "$4" The two digits indicating the province. .ie n .IP "$5" 4 .el .IP "\f(CW$5\fR" 4 .IX Item "$5" The digit indicating the main city or main delivery route. .ie n .IP "$6" 4 .el .IP "\f(CW$6\fR" 4 .IX Item "$6" The digits indicating the delivery area, secondary delivery route or a link to rural areas. .ie n .SS """$RE {zip} {Switzerland}""" .el .SS "\f(CW$RE {zip} {Switzerland}\fP" .IX Subsection "$RE {zip} {Switzerland}" Returns a pattern that recognizes Swiss postal codes. Swiss postal codes consist of 4 digits, but not all combinations are used. Postal codes starting with 948 and 949 are for location in Liechtenstein, and will not be recognized by the pattern for Swiss postal codes. Use \f(CW\*(C`$RE {zip} {Liechtenstein}\*(C'\fR for those. .PP If \f(CW\*(C`{\-keep}\*(C'\fR is used, the following variables will be set: .ie n .IP "$1" 4 .el .IP "\f(CW$1\fR" 4 .IX Item "$1" The entire postal code. .ie n .IP "$2" 4 .el .IP "\f(CW$2\fR" 4 .IX Item "$2" The country code prefix. .ie n .IP "$3" 4 .el .IP "\f(CW$3\fR" 4 .IX Item "$3" The postal code without the country prefix. .PP The country prefix is \fI\s-1CH\s0\fR, for both the \s-1ISO\s0 and \s-1CEPT\s0 prefixes. .ie n .SS "$RE{zip}{US}{\-extended => [yes|no|allow]}" .el .SS "\f(CW$RE{zip}{US}{\-extended => [yes|no|allow]}\fP" .IX Subsection "$RE{zip}{US}{-extended => [yes|no|allow]}" Returns a pattern that recognizes \s-1US\s0 zip codes. \s-1US\s0 zip codes consist of 5 digits, with an optional 4 digit extension. By default, extensions are allowed, but not required. This can be influenced by the \&\f(CW\*(C`\-extended\*(C'\fR option. If its argument starts with a \f(CW\*(C`y\*(C'\fR, extensions are required; if the argument starts with a \f(CW\*(C`n\*(C'\fR, extensions will not be recognized. If an extension is used, a dash is used to separate the main part from the extension, but this can be changed with the \f(CW\*(C`\-sep\*(C'\fR option. .PP The country prefix is either \fI\s-1US\s0\fR (the \s-1ISO\s0 country code), or \&\fI\s-1USA\s0\fR (the \s-1CEPT\s0 code). .PP If \f(CW\*(C`{\-keep}\*(C'\fR is being used, the following variables will be set: .ie n .IP "$1" 4 .el .IP "\f(CW$1\fR" 4 .IX Item "$1" The entire postal code. .ie n .IP "$2" 4 .el .IP "\f(CW$2\fR" 4 .IX Item "$2" The country code prefix. .ie n .IP "$3" 4 .el .IP "\f(CW$3\fR" 4 .IX Item "$3" The postal code without the country prefix. .ie n .IP "$4" 4 .el .IP "\f(CW$4\fR" 4 .IX Item "$4" The first 5 digits of the postal code. .ie n .IP "$5" 4 .el .IP "\f(CW$5\fR" 4 .IX Item "$5" The first three digits of the postal code, indicating a sectional center or a large city. New in Regexp::Common 2.119. .ie n .IP "$6" 4 .el .IP "\f(CW$6\fR" 4 .IX Item "$6" The last 2 digits of the 5 digit part of the postal code, indicating a post office facility or delivery area. New in Regexp::Common 2.119. .ie n .IP "$7" 4 .el .IP "\f(CW$7\fR" 4 .IX Item "$7" The separator between the 5 digit part and the 4 digit part. Up to Regexp::Common 2.118, this used to be \f(CW$5\fR. .ie n .IP "$8" 4 .el .IP "\f(CW$8\fR" 4 .IX Item "$8" The 4 digit part of the postal code (if any). Up to Regexp::Common 2.118, this used to be \f(CW$6\fR. .ie n .IP "$9" 4 .el .IP "\f(CW$9\fR" 4 .IX Item "$9" The first two digits of the 4 digit part of the postal code, indicating a sector, or several blocks. New in Regexp::Common 2.119. .ie n .IP "$10" 4 .el .IP "\f(CW$10\fR" 4 .IX Item "$10" The last two digits of the 4 digit part of the postal code, indicating a segment or one side of a street. New in Regexp::Common 2.119. .PP \fIQuestions\fR .IX Subsection "Questions" .IP "\(bu" 4 Can the 5 digit part of the zip code (in theory) start with 000? .IP "\(bu" 4 Can the 5 digit part of the zip code (in theory) end with 00? .IP "\(bu" 4 Can the 4 digit part of the zip code (in theory) start with 00? .IP "\(bu" 4 Can the 4 digit part of the zip code (in theory) end with 00? .ie n .SS """$RE {zip} {\*(AqVatican City\*(Aq}""" .el .SS "\f(CW$RE {zip} {\*(AqVatican City\*(Aq}\fP" .IX Subsection "$RE {zip} {Vatican City}" Vatican City uses a single postal code; taken from the Italian system of postal codes, and sharing the single code with a part of Rome. .PP If \f(CW\*(C`{\-keep}\*(C'\fR is used, the following variables will be set: .ie n .IP "$1" 4 .el .IP "\f(CW$1\fR" 4 .IX Item "$1" The entire postal code. .ie n .IP "$2" 4 .el .IP "\f(CW$2\fR" 4 .IX Item "$2" The country code prefix. .ie n .IP "$3" 4 .el .IP "\f(CW$3\fR" 4 .IX Item "$3" The postal code without the country prefix. .PP The country prefix for Vatican City is \f(CW\*(C`VA\*(C'\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" Regexp::Common for a general description of how to use this interface. .IP "" 4 .IX Item "" Frank's compulsive guide to postal addresses. .IP "" 4 .IX Item "" Postal addressing systems. .IP "" 4 .IX Item "" Postal code information. .IP "" 4 .IX Item "" Links to Postcode Pages. .IP "" 4 .IX Item "" All Australian postal codes in use. .IP "" 4 .IX Item "" Information about \s-1US\s0 postal codes. .IP "" 4 .IX Item "" .PD 0 .IP "" 4 .IX Item "" .PD Lots of zip files with active postal codes. .IP "" 4 .IX Item "" Find postal codes. .SH "AUTHORS" .IX Header "AUTHORS" Damian Conway (\fIdamian@conway.org\fR) and Abigail (\fIregexp\-common@abigail.be\fR). .SH "MAINTENANCE" .IX Header "MAINTENANCE" This package is maintained by Abigail (\fIregexp\-common@abigail.be\fR). .SH "BUGS AND IRRITATIONS" .IX Header "BUGS AND IRRITATIONS" Zip codes for most countries are missing. Send them in to \fIregexp\-common@abigail.be\fR. .SH "LICENSE and COPYRIGHT" .IX Header "LICENSE and COPYRIGHT" This software is Copyright (c) 2001 \- 2017, Damian Conway and Abigail. .PP This module is free software, and maybe used under any of the following licenses: .PP .Vb 4 \& 1) The Perl Artistic License. See the file COPYRIGHT.AL. \& 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. \& 3) The BSD License. See the file COPYRIGHT.BSD. \& 4) The MIT License. See the file COPYRIGHT.MIT. .Ve