title: Python Negative Lookbehind with a variable number of characters
body: <p>I know there are a lot of regex and negative lookbehind questions but I have one that I cannot find an answer to. I want to find instances of <strong>water</strong> but not if it has <strong>never</strong> in front of it with a variable number of characters between the two. There is an infinite number of variable characters between these two words and <strong>lookbehind does not allow for variable characters</strong>. I have code that will find never but it will find never at the very start of the script. <strong>Is there a way to limit a lookbehind to only 20 or 30 characters?</strong> What I have:</p>
  <pre><code>(?i)^(?=.*?(?:water))(?:(?!never).)*$
  </code></pre>
  <p>Just some of the examples I am working with:</p>
  <pre><code>water                                                         (match)
  I have water                                                  (match)
  I never have water
  Where is the water.                                           (match)
  I never have food or water
  I never have food but I always have water                     (match)
  I never have food or chips. I like to walk. I have water      (match)
  </code></pre>
  <p>Again, the problem is that I could have a paragraph that is 10 sentences long and if it has <strong>never</strong> any where in there it will not find <strong>water</strong> and that lookbehind and lookahead does not accept variable characters. I appreciate any help you could give.</p>