Frank Morawietz <[EMAIL PROTECTED]> writes:
> since I upgraded to BBDB 2.2, I use the following continental zip code
> regexp
>
> "\\(^\\s *[A-Z][A-Z]?\\s *-\\s *[0-9][0-9][0-9]\\|^\\s *[1-9][0-9][0-9][0-9][0-9]\\)"
>
> which basically matches the old continental zip codes and German
> ones (5 digits with the first one not being zero and no spaces in
> between). It catches one US zipcode (Williamsville, NY 14221) in my
> database as well, but apart from that it works well.
>
> probably one could make the regexp more compact, but keeping the two
> types of zipcodes separate helps me remembering what I did....
Yes, something like that is what I had in mind. But it doesn't match
"133 36" so it doesn't solve my problem. And wouldn't it match almost
_every_ US zip code?
The following regexp works for US, Swedish (with and without "SE-"),
Danish, Dutch, German, Spanish, and Swiss zip codes in my database:
"^\\s *\\([A-Z][A-Z]?\\s *-\\s *[0-9][0-9][0-9]\\|[0-9][0-9][0-9] [0-9][0-9]\\)"
But then you have to keep the country prefix for all countries except
Sweden and the US... Well, at least it fixes the problem I wanted to
solve without breaking anything else (I hope :o), so maybe it could be
the default?
Another thought: What if continental style was the default and the US
style (with the zip code displayed after the city) used only if the
State field is non-empty? Then we would not need these regexps at all,
at least not for Europe and north America. Well, I don't know what a
Mexican address should look like. And I don't know much about what
addresses should look like in other parts of the world, either.
--
Mats Löfdahl + Voice: +46 8 16 44 80
Royal Swedish Academy of Sciences + Fax: +46 8 16 42 28
Stockholm Observatory + [EMAIL PROTECTED]
SE-133 36 Saltsjöbaden, Sweden + [EMAIL PROTECTED]
_______________________________________________
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/