Split address in SQL database with a new line

We have a database with column called street, this field now contains both street and house number on one line. We need to have the house number on the second line in the same column.

So now the column is like:

Street 12

And it needs to be:


I have a regex available to split the street field. I dont think I can use this directly in phpMyAdmin orso, but I guess we should be able to create a small script to get the street value and resave it with a new line (\n)?

Hopefully someone can help us out!

Edit #1:


/^(\d*[\wäöüß\d '\/\\\-\.]+)[,\s]+(\d+)\s*([\wäöüß\d\-\/]*)$/i

Read more here: https://stackoverflow.com/questions/67923312/split-address-in-sql-database-with-a-new-line

Content Attribution

This content was originally published by JorgB at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: