I would really appreciate your help on the following problem:
I have a column containing addresses (all mixed together). These addresses are quite heterogeneous, so a simple selection based on position won't do it. Thanks to helpful people on stackoverflow, I already found a regex pattern to split it up. Now the only question left is how to perform an SQL UPDATE query in order to separate the address (maybe regexp_replace() will do the job?).
current format:
Street 123
12343 City
target format:
address: street 123
zip: 12343
city: City
regex pattern:
^([a-zäöüß\s\d.,-]+?)\s*([\d\s]+(?:\s?[-|+/]\s?\d+)?\s*[a-z]?)?\s*(\d{4,5})\s*(.+)?$
So the goal is to update the columns city and zip with the relevant part of the String. The current field address should only contain the first line afterwards.
Thanks for your help!