I always assumed regex worked like this, but I guess I never hit a case like this until now and I'm not sure the best way to tackle it.
String to consider:
apple
apple
apple
cat
I want to use something like apple.*?cat, however, this matches the first apple to the cat when I really want the last apple and cat.
Please keep in mind this is just an example, I'm looking for a generalized way to do this (ie telling me to just match one newline between apple and cat won't work in my real case)