Using SQL 2025, extract the house number from German address under varying scenarions:
Examples below need to be redeveloped:
declare @P002 nvarchar (50)
declare @P003 NVARCHAR(50) = N'(\d+[a-zA-Z\-]*)(\s*(,|\d+|[A-Z]{2,}|$))' --Only Extracts "2"
--N'(^([^,]+)(\d+[a-zA-Z\-]*)(\s*(,|\d+|[A-Z]{2,}|$)))' --This only extracts the "1/2" value of the house number instead of "11 1/2"
--Schertlinstraße 11 1/2, 86157 Augsburg, Germany
SELECT REPLACE(REGEXP_SUBSTR(@P001, @P003, 1, 1, 'c'), ',', '')
... Show more