Optimize as necessary.my $input = "Holland, MI 82904-4413"; my ($city, $state, $zip) = split(' ', $input); $city =~ s/,$//; bad_zip($zip) unless ($zip =~ /^\d{5}(-)?(\d{4})?$/);
In reply to Re: regexp
by chromatic
in thread regexp
by wepu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |