title: Regex for string not ending with given suffix
body: <p>I have not been able to find a proper regex to match any string <em>not</em> ending with some condition. For example, I don't want to match anything ending with an <code>a</code>.</p>
  
  <p><strong>This matches</strong></p>
  
  <pre><code>b
  ab
  1
  </code></pre>
  
  <p><strong>This doesn't match</strong></p>
  
  <pre><code>a
  ba
  </code></pre>
  
  <p>I know the regex should be ending with <code>$</code> to mark the end, though I don't know what should preceed it.</p>
  
  <p><strong>Edit</strong>: The original question doesn't seem to be a legit example for my case. So: how to handle more than one character? Say anything not ending with <code>ab</code>?</p>
  
  <p>I've been able to fix this, using <a href="http://www.perlmonks.org/?node_id=188907" rel="noreferrer">this thread</a>:</p>
  
  <pre><code>.*(?:(?!ab).).$
  </code></pre>
  
  <p>Though the downside with this is, it doesn't match a string of one character.</p>