Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Data Salad Address Problem

by socketdave (Curate)
on Jul 28, 2005 at 15:02 UTC ( [id://478998]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Data Salad Address Problem
in thread Data Salad Address Problem

You're basically going to have to quantify the different possibilities and allow for them individually. I was able to get the zip codes accurately from your sample data:

unless ( ($zip) = ($field5 =~ /(\d{5}-\d{4})/)) { unless ( ($zip) = ($field5 =~ /(\d{5})/)) { unless ( ($zip) = ($field4 =~ /(\d{5}-\d{4})/) +) { ($zip) = ($field4 =~ /(\d{5})/); + } } }


but that's already pretty nasty...

Replies are listed 'Best First'.
Re^4: Data Salad Address Problem
by bofh_of_oz (Hermit) on Jul 29, 2005 at 12:39 UTC
    Actually, I see that the third record from the bottom has a 5-digit ZIP code, with no dash and other part... Could be that we need to make the second part optional... Yeah, oh joy...

    --------------------------------
    An idea is not responsible for the people who believe in it...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://478998]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-25 06:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found