Regexp::Common::zip

Provide regexes for postal codes
Download

Regexp::Common::zip Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Damian Conway
  • Publisher web site:
  • http://search.cpan.org/~dconway/

Regexp::Common::zip Tags


Regexp::Common::zip Description

Provide regexes for postal codes Regexp::Common::zip is a Perl module to provide regexes for postal codes.SYNOPSIS use Regexp::Common qw /zip/; while () { /^$RE{zip}{Netherlands}$/ and print "Dutch postal code "; }Please consult the manual of Regexp::Common for a general description of the works of this interface.Do not use this module directly, but load it via Regexp::Common.This module offers patterns for zip or postal codes of many different countries. They all have the form $RE{zip}{Country}.The following common options are used:{-prefix=} and {-country=PAT}.Postal codes can be prefixed with a country abbreviation. That is, a dutch postal code of 1234 AB can also be written as NL-1234 AB. By default, all the patterns will allow the prefixes. But this can be changed with the -prefix option. With -prefix=yes, the returned pattern requires a country prefix, while -prefix=no disallows a prefix. Any argument that doesn't start with a y or a n allows a country prefix, but doesn't require them.The prefixes used are, unfortunally, not always the same. Officially, ISO country codes need to be used, but the usage of CEPT 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 ISO standard or the CEPT code. That is, German postal codes may prefixed with either DE or D. The recognized prefix can be changed with the -country option, which takes a (sub)pattern as argument. The arguments iso and cept are special, and indicate the language prefix should be the ISO country code, or the CEPT code. Requirements: · Perl


Regexp::Common::zip Related Software