i' going to extract business value from a String. But my problem is, that the string repeates each time in a loop. And the content syntax is always the same, but the content is changing. Thus I need a reg-expr which helps me to extract the data.
What I have tried so far:
("^\\d{1,2}(.{1})\\s([A-Za-z]{2})\\s(([A-Z]\\d{2,3}))\\s.")
But the the above provided pattern outputs me only the first three arguments: 01. Di F929
Sample String shows like following:
01. Di F929 * Fr F929 Fr FREI Mo S688 Mi S49 * Sa S57 Mo F929 Do F224 So S49 Di X337 Fr F56 So FREI \n
Let me explain how the string is build.
- (01.) is a digit from 01 to 31.
- Following be shortWeekDays (German) (Mo, Di, Mi, ..)
- Word start with Character ends with digit (F929, S49, ...)
- (Optional) a special character like '*, X, ...'
Important:
Di + F929 + *represents single data-block. Each String contains about 12 data-blocks.
My need is, a regular expression which match the above problem. Thanks in regard!
^anchor^doesn't help me. The word 'FREI' in the string doesn't appear or doesn't match