Me also confused about previous post mention by Jking,
Jking., wrote:How is that data being accessed?
Is it a web page?
What is your end goal?
Are you extracting the data into variables?
There are lots of conditions coming in website based on the sources, Here i give some examples,Example 1.Example 2.
How you are extracted the initial value, May be in a single variable, the above example, if the condition is like example 1 mean you can simply extract the city, state and zip or you can extract full address in to a varibale then you can convert it in to different variables. Here you can utilize the html tags.
But in example 2 full address in a single tag, so its very difficult to split, because we can't give a proper patterns for splitting city, state and zip. Because may be city is a single word or more than one, likewise state also, so we can't predict a common pattern.
Here i am giving some examples, North Vancouver British Columbia V7M 2J3
In the above address zip is always having a common pattern, So you can extract full address in to a single variable and first extract the zip using a common pattern like,
.* (\w\d\w\s\d\w\d) or .*?(\w*\s\w*)
Now you got the full address in a variable, zip in an another variable, then need to extract city and state, in the above example 2, we can't give a commen pattern and there is no delimiter for splitting. So i am applying a simple logic for extracting the city.
Here you can load this URL http://www.whatismyzip.com/
and enter the zip in the search box and find, now we got the full address with delimiter.
From here you can extract city using the delimiter is comma(,) pattern like (.*?),.*
After that you can replace city, zip from the full_address variable, now you got the state.
I believe this post helps you, if any doubts or suggestions please keep in touch.