title: Regex for all files except .hg_keep
body: <p>I use empty <code>.hg_keep</code> files to keep some (otherwise empty) folders in Mercurial.</p>
  
  <p>The problem is that I can't find a working regex which excludes everything but the <code>.hg_keep</code> files.</p>
  
  <p>lets say we have this filestructure:</p>
  
  <pre><code>a/b/c2/.hg_keep
  a/b/c/d/.hg_keep
  a/b/c/d/file1
  a/b/c/d2/.hg_keep
  a/b/.hg_keep
  a/b/file2
  a/b/file1
  a/.hg_keep
  a/file2
  a/file1
  </code></pre>
  
  <p>and I want to keep only the <code>.hg_keep</code> files under <code>a/b/</code>.</p>
  
  <p>with the help of <a href="http://gskinner.com/RegExr/" rel="nofollow">http://gskinner.com/RegExr/</a> I created the following <code>.hgignore</code>:</p>
  
  <pre><code>syntax: regexp
  .*b.*/(?!.*\.hg_keep)
  </code></pre>
  
  <p>but Mercurial ignores all <code>.hg_keep</code> files in subfolders of <code>b</code>.</p>
  
  <pre><code># hg status
  ? .hgignore
  ? a/.hg_keep
  ? a/b/.hg_keep
  ? a/file1
  ? a/file
  
  # hg status -i
  I a/b/c/d/.hg_keep
  I a/b/c/d/file1
  I a/b/c/d2/.hg_keep
  I a/b/c2/.hg_keep
  I a/b/file1
  I a/b/file2
  </code></pre>
  
  <p>I know that I a can <code>hd add</code> all the <code>.hg_keep</code> files, but is there a solution with a regular expression (or glob)?</p>