title: Regex negative lookbehinds with a wildcard
body: <p>I'm trying to match some text if it does not have another block of text in its vicinity. For example, I would like to match <code>"bar"</code> if <code>"foo"</code> does not precede it. I can match <code>"bar"</code> if <code>"foo"</code> does not <em>immediately</em> precede it using negative look behind in this regex:</p>
  
  <pre><code>/(?&lt;!foo)bar/
  </code></pre>
  
  <p>but I also like to not match <code>"foo 12345 bar"</code>. I tried:</p>
  
  <pre><code>/(?&lt;!foo.{1,10})bar/
  </code></pre>
  
  <p>but using a  wildcard + a range appears to be an invalid regex in Ruby. Am I thinking about the problem wrong?</p>