title: Regex and powershell - Get string before slash
body: <p>I have a list of directories with files like this:</p>
  
  <pre><code>testing_module/forms/node.js
  terraform_packer/globals.js
  protection_list/forms/security.js
  </code></pre>
  
  <p>I want to get with <code>powershell</code> only the folder before the slash:</p>
  
  <pre><code>testing_module
  terraform_packer
  protection_list
  </code></pre>
  
  <p>I use <code>-replace</code> with this regex expression to test it:</p>
  
  <pre><code>'testing_module/forms/node.js' -replace '/([^/]+/[^/]+)$'
  </code></pre>
  
  <p>But it returns the full line.</p>
  
  <p>What should I use?</p>