I've seen many iterations of extracting w/ gsub but they mostly deal with extracting from left to right or after one occurrence. I am wanting to match from right to left, counting four occurrences of -, matching everything between the 3rd and 4th occurrence.
For example:
string outcome
here-are-some-words-to-try some
a-b-c-d-e-f-g-h-i f
Here are a few references I've tried using: