I want to extract the last occurrence of a string from a long string where this string occurs one or more times. I've tried a few different look ahead expressions but haven't been able to figure this out.
The string is something like:
AAA|BBB|Teststring:21|ZZZ|Teststring:23|Test 50
I tried using something an expression like:
(?:Teststring:\d+.(Teststring:\d+).$)
This works for those cases where there are more than one occurrences of Teststring, but fails when there is only one. So it works in the above test example but will fail for the below string:
AAA|BBB|Teststring:21|ZZZ 10