in reply to Re: In-place file filtering
in thread In-place file filtering

from the docs of Regexp::Common::zip
US zip codes consist of 5 digits, with an optional 4 digit extension

But this allows zip codes which are not currently valid.

Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality

Replies are listed 'Best First'.
Re^3: In-place file filtering
by adrianh (Chancellor) on Jul 24, 2003 at 22:17 UTC

    Fair point. Might be worth dropping a bug-report/patch to Abigail-II.

    Where do you get the info on which US codes are valid/invalid?

      To actually get the list of zip codes costs money, either from the USPS or other sources. However, by repeatedly typing in zip codes into the zip code locator as USPS.com I found out the valid upper and lower bounds.

      Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality

        Don't new codes get added? In other countries valid/invalid codes aren't contiguous sequences. I'd assumed that the lower/upper bounds were part of the spec? If not I'm not sure I'd rely on all the codes outside those bounds being invalid if it were me.

      Your friendly snail-mail corp will sell you same (sorta' -- they'll sell list of valid zips, from which one can deduce the 5 digit #s which are NOT valid.) But bigbuck$$$$.