[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Omaha.pm] Regexp::Common::zip is pretty slick
Wow. This would have been nice to have back in 1999 when I worked for
a European telcom...
CPAN rules.
j
/$RE{zip}{Germany}/;
# Matches 'DE-12345' and 'D-12345'.
/$RE{zip}{Germany}{-country => 'iso'}/;
# Matches 'DE-12345' but not 'D-12345'.
/$RE{zip}{Germany}{-country => 'cept'}/;
# Matches 'D-12345' but not 'DE-12345'.
/$RE{zip}{Germany}{-country => 'GER'}/;
# Matches 'GER-12345'.
http://search.cpan.org/~abigail/Regexp-Common-2.120/lib/Regexp/Common/
zip.pm