I have a webcall that give me the following callback as string:
ZIPCODE | CITY | STREET NR | , |Phone Number with (Tel.) on the beginning
EXAMPLE1 :
83661 Lenggries Marktstr. 14, Tel. 08042 91860
I would like to ask the regex professionals if it would be possible to break them down into groups? My best try at the moment is:
([0-9]{5})(\s[a-zA-Z].+)(\s[a-zA-Z].+)(\s.*)(\s.[0-9]*)(\s.[0-9]*)
which results in:
- 83661
- Lenggries
- Marktstr. 14,
- Tel.
- 08042
- 91860
This works for the sample above but is not a stable regex, for example:
EXAMPLE2:
83620 Feldkirchen-Westerham Aiblinger Str. 7, Tel. 08063 8562
results in:
- 83620
- Feldkirchen-Westerham Aiblinger
- Str. 7,
- Tel.
- 08063
- 8562
Maybe somebody can help me with this problem, I have no idea how to solve it. The data cannot be given in any other format either. :(
regards and thanks in advance Matthias