Given long list of lines in a text file I only want to return the substring that immediately precedes, for example, the word dog (the word that describes dog). So for example say there are these lines containing dog:

```
“hotdog” “big dog” “is dogged” “dog spy” “with my dog” “brown dogs”

```

In this case the desired result is only “big” “my” “brown” 

I have used this python script 

```
import re
with open('titles_500subset.txt') as searchfile:
    for line in searchfile:
        line = line.lower()
        d = re.search('(.+?) eye', line)
        if d:
            found = d.group(1)
            print found

```

This would return `“with my”` and `“big”` 

So here I wouldn't get `“brown”` and I get all the terms `“with my”`

How do I specify just one word before dog (obviously I cannot put a space before `(.+?)` as then I would exclude `“big”` and `“brown”` as they are at the start of a line)?

How can I specify just one character to come after dog e.g. `“s”` to get only words before dogs and dog but not dogged?

And in a perfect case I’d also like to be able to specify results to exclude, e.g. `“my”`.

Many thanks