title: Regex to match a set of words that is not preceded by, within 25 characters, another set of words
body: <p>I'd like to write a regex to match a set of words (offered/gave me a job.) that is not preceded by, within 25 characters, another set of words(did not, would not, etc) within the same sentence. I more or less understand how to get the group of words, but I cannot figure out why the negative lookbehind doesn't work here. Also, I need to accomplish this in only one regex, and I am using python to test these. Here are some example matches/non-matches:</p>
  
  <pre><code>Match:
  he offered me a job
  she gave me a job
  
  Does not match:
  he did not even offer me a job
  she would not give me a job
  he did not think about offering me a job
  </code></pre>
  
  <p>Here is my regex so far: <code>(?&lt;!did not)[^\.\n]{0,25}(?:(?:offer(ed|ing|s)?|g[ai]ves?)[^\.\n\!\?]{0,25}(?:job))</code></p>
  
  <p>And here's a <a href="https://regex101.com/r/aDGUkg/3" rel="nofollow noreferrer">regex101 link</a>.</p>