I am trying to extract data from a change log using RegEx. Here is an example how the change log is structured:
96545
this is some changes in the ticket
some new version: x.x.22
another change
new version: x.y.2.2
120091
this is some changes in the ticket
some new version: z.z.22
another change
another change
another change
new version: z.y.2.2
120092
...
...
...
- Each data point starts with an ID which has a range of 5 to 6 digits.
- Moreover there is a variable amount of changes (lines) in the log per ID.
- Each data point ends with
new version: ***
.***
is string which is variable for every ID.
I was using the RegExStrom Tester to test my RegEx.
So far I have: ^\w{5,6}(.|\n)*?\d{5,6}
however the result includes the ID from the next ticket, which I need to avoid.
Result:
96545
this is some changes in the ticket
some new version: x.x.22
another change
new version: x.y.2.2
120091
Expected Result:
96545
this is some changes in the ticket
some new version: x.x.22
another change
new version: x.y.2.2