Yep, another regex (javascript implementation) question...
I can't figure out how to find the string 'cat' as long as it occurs anywhere ahead of 'dog'.
So for the following sentence...
cat categorically hates the dog, im going to mention cat again.
The first and second occurrences will be found, not the last one.