title: PowerShell Regex match beginning of string
body: <p>There's a regex that does exactly what I want, but I would like it to be able to only check the beginning of the string and don't look at the stuff coming after it.</p>
  
  <p><strong>Working regex:</strong></p>
  
  <pre><code>[RegEx]$RegEx = "(.+?) (.+?)-(.+?)-(.+?)$"
  </code></pre>
  
  <p><strong>Failed attempts:</strong></p>
  
  <pre><code>[RegEx]$RegEx = "^((.+?) (.+?)-(.+?)-(.+?))"
  [RegEx]$RegEx = "\A(.+?) (.+?)-(.+?)-(.+?)"
  </code></pre>
  
  <p><strong>Examples:</strong></p>
  
  <pre><code># Ok:
  BEL Green-Fruit-Appel Stuff
  BEL Green-Fruit-Appel Other stuff stuff
  
  # Not ok (without anything):
  BEL Green-Fruit-Appel            
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/25199659/powershell-how-to-generate-multiple-combinations/25209228#25209228">More info here</a></p>
  
  <p>Thank you for your help.</p>