Try this:
/(^|\s)(dog)(?=\s|$)/gm
Tested via regexr - http://regexr.com?38gla
This matches a start of string or whitespace, then the word dog, then whitespace or end of string. The trailing whitespace/end of string is a positive lookahead, so its not consumed, allowing that space to be used for another match - ex "cat dog dog"