I am trying to create a regex expression that starts with a specific word and ignores any other similar words.
For example, if my line begins with the word “dog” and ends with “fish,” how can I ignore any ongoing “dog” words and match only the last?
dog Cat
dog cat-dog <- ignore the first word "dog" and match the second word "dog".
dog dog cat-dog fish <- ignore the first and second words "dog" and match the third word "dog".
source
share