title: How do I return only the matching regular expression when I select-string(grep) in PowerShell?
body: <p>I am trying to find a pattern in files. When I get a match using <code>Select-String</code> I do not want the entire line, I just want the part that matched. </p>
  
  <p>Is there a parameter I can use to do this?</p>
  
  <p>For example:</p>
  
  <p>If I did </p>
  
  <pre><code>select-string .-.-.
  </code></pre>
  
  <p>and the file contained a line with:</p>
  
  <pre><code>abc 1-2-3 abc
  </code></pre>
  
  <p>I'd like to get a result of just <strong>1-2-3</strong> instead of the entire line getting returned.</p>
  
  <p>I would like to know the Powershell equivalent of a <code>grep -o</code></p>