I can't get this regex to work.
The entry is as follows. Its valid on one line, but I inserted line breaks after each \ r \ n to make it easier to see, so whitespace is not required.
01-03\r\n
01-04\r\n
TEXTONE\r\n
STOCKHOLM\r\n
350,00\r\n
12-29\r\n
01-03\r\n
TEXTTWO\r\n
COPENHAGEN\r\n
10,80\r\n
This may continue with others 01-31 and 02-01, marking another new coincidence (these are dates).
I would like to have a total of 2 matches for this input. My problem is that I can’t understand how to look forward and match the start of a new match (the next two dates), but not include these dates in the first match. They must belong to the second match.
It's hard to explain, but I hope someone delivers me. This is what I got so far, but didn’t even close it:
(.*?)((?<=\\d{2}-\\d{2}))
I want a match:
1: 01-03\r\n01-04\r\nTEXTONE\r\nSTOCKHOLM\r\n350,00\r\n
2: 12-29\r\n01-03\r\nTEXTTWO\r\nCOPENHAGEN\r\n10,80\r\n
After that, I can easily split the columns with \ r \ n.