I have some data like that in a file.
Start
Status:good<>
Status:bad<>
Status:dfsf<>
Status:gosdfsfod<>
Status:dogEatsCat<>
Some randomdata
End
<> is just end of status information
I just want to get last status. This one “dogEatsCat”.
This regex is returning me all the statuses.
Status:(.+?)<>
But I just want to get the last one.
EDIT
Alternatively, you can grab all matches and return the last match captured. This can be done like the following: