This is problematic because most flavors do not support variable-length look, so you cannot check the entire string. A simple approach is to match the entire string, rather than using search queries:
^(?!.*\bbears\b).*?\blive and\b(.*?)\bwoods\b
Here, first of all, was the first coincidence. Depending on what you use, you can replace this text with a little less convenient. Remember to use the muliline flag ( /m ), and not set the single-line flag (dot-all or /s ).
Working example: http://rubular.com/r/TuADb2vB4w
Note that the problem becomes very simple if you can solve it in two steps: filter the lines with \bbears\b and match the required line.
Kobi source share