import re

strings = [
	"the owner has a dog",
	"the owner has a black and brown dog",
	"John has a dog",
	"John has a black and brown dog"
]

pattern = r"^[^o\r\n]*(?:(?!\bowner\b)o[^o\r\n]*)*\bdog\b"

for s in strings:
  res = re.search(pattern, s)
  print(res)