title: grunt (minimatch/glob) folder exclusion
body: <p>I have a situation where I'm trying to use grunt to lint a codebase, excluding specific folders.</p>
  
  <p>grunt uses minimatch (similar to bsdglob) under the hood to match files, but I can't seem to figure out how to do a .gitignore style exclude of a folder.</p>
  
  <p>I'd like to ingest this:</p>
  
  <p><code>ignoreme</code></p>
  
  <p>and match these:</p>
  
  <pre><code>/folder/path/here/to/something/ok.js
  /another/folder/path.js
  /test.js
  </code></pre>
  
  <p>but not match these:</p>
  
  <pre><code>/folder/ignoreme/something.js
  /folder/path/here/to/ignoreme/metoo/file.js
  </code></pre>
  
  <p>This will match everything, including ignoreme:</p>
  
  <pre><code>/**/*.js
  </code></pre>
  
  <p>So I figured I could do something like:</p>
  
  <pre><code>/**/!(ignoreme)/**/*.js
  </code></pre>
  
  <p>but that matches files in the ignoreme folder.</p>
  
  <p>I'm used to regexes, but can't seem to figure out how to repeat a pattern or something here - I also tried stuff like:</p>
  
  <pre><code>/(!(ignoreme)|*)*/*.js
  </code></pre>
  
  <p>hoping the container would repeat, but that doesn't work, it just fails to match everything.</p>
  
  <p>Any way to either pass a regex to grunt file paths, or make this work for me?</p>
  
  <h1>Update:</h1>
  
  <p>Here's how I'm currently dealing with this issue:</p>
  
  <pre><code>var pattern = /\/ignoreme\//
  var files = grunt.file.expandFiles(arrayOfFilesPassedToMinimatch).filter(function(f){
    return !pattern.test(f)
  })
  </code></pre>
  
  <p>I'd still be interested if folder excludes are possible in minimatch.</p>