User input parsing - city / state / zipcode / country
I'm looking for advice on parsing input from a user in multiple combinations of City / State / Zip Code / Country. A common example would be what Google maps does. Some examples of input would be: "City, State, Country" "City, Country" "City, Zip Code, Country" "City, State, Zip Code" "Zip Code" What would be an efficient and correct way to parse this input from a user? If you are aware of any example implementations please share :) The first step would be to break up the text into individual tokens using spaces or commas as the delimiting characters. For scalability, you can then hand each