title: Regex exclude a folder from node_modules
body: <p>I am currently using webpack and running a test that goes through node_modules and excludes one specific module. </p>
  
  <p>However, i am struggling with the regular expression as i am trying it on the regex checker, and it works fine. However, on the webpack it fails.</p>
  
  <p><strong>Example</strong>: <a href="https://regex101.com/r/rO4jD0/34" rel="nofollow noreferrer">https://regex101.com/r/rO4jD0/34</a></p>
  
  <pre><code>^node_modules\/(?!example).*
  </code></pre>
  
  <p>On the webpack itself, i am writing the following:</p>
  
  <pre><code>vendor: {
      test: /^[\\/]node_modules[\\/](?!example).*[\\/]/,
      // test: /^[\\/]node_modules[\\/](?!example)[\\/].*/,
      // test: /^node_modules\/(?!example).*/,
      name: 'vendor',
      chunks: 'all',
  }
  </code></pre>
  
  <p>The tests are examples of the tests i've run so far but unfortunately all of them failed.</p>
  
  <p><strong>As an FYI</strong> - this works fine but it <strong>doesnt</strong> exclude that one <strong>example</strong> folder.</p>
  
  <pre><code>test: /[\\/]node_modules[\\/]/,
  </code></pre>