So, I need an address from a string, but I have different cases, so I covered many, but now I can not work with this case:
Original line:
HRB 145942: playloop UG (haftungsbeschränkt), Hamburg, Eimsbütteler Chaussee 57, c / o Jan Sorgenfrei , 20259 Hamburg. Gesellschaft mit beschr
HRB 145941: TBE-Ehrbare Rebellen GmbH, Hamburg, Friedrich-Ebert-Damm 111 , 22047 Hamburg. Gesellschaft mit beschr
HRB 145923: Lionheart Asset Management GmbH, München, Trenknerweg 100 A, c / o Barthold Brümmer , 22605 Hamburg. Gesellschaft mit beschr
HRB 716239: CarboCode Germany GmbH, Konstanz, Byk-Gulden-Straße 2, Gebäude F21 , 78467 Konstanz. Gesellschaft mit beschr
So I need " Eimsbütteler Chaussee 57, c / o Jan Sorgenfrei 'and' Friedrich-Ebert-Damm 111 " and " Trenknerweg 100 A, c / o Barthold Brümmer " and " Byk-Gulden-Straße 2, Gebäude F21 "
Even the address without c / o helped me a lot My RegEx: , \d{5}.+\.
And my problem is that it gets normal addresses like "Friedrich ..", but in the addresses "c / o" it just takes it as "c / o Jan Sorgenfrei" and skips the line earlier or just takes "Gebäude F21" .
After getting the string from RegEx, I do the following to filter out some things:
stadt = stadt.Substring(0, stadt.LastIndexOf('.'));
stadt = new string(stadt.Where(c => c != '-' && (c < '0' || c > '9')).ToArray());
stadt = stadt.Substring(1);