title: Powershell Regex Grouping from Select-String
body: <p>I am scraping a web request response to pull information held within html code which repeats a few times so using select-string rather than match. My code looks like</p>
  
  <pre><code>$regexname = '\(\w{0,11}).{1,10}\'
  $energenie.RawContent | select-string $regexname -AllMatches | % {$_.matches}
  </code></pre>
  
  <p>The return looks something like:</p>
  
  <pre><code>Groups : {&lt;h2 class="ener"&gt;TV &lt;/h2&gt;, TV}
  Success : True
  Captures : {&lt;h2 class="ener"&gt;TV &lt;/h2&gt;}
  Index : 1822
  Length : 33
  Value : &lt;h2 class="ener"&gt;TV &lt;/h2&gt;
  
  Groups : {&lt;h2 class="ener"&gt;PS3 &lt;/h2&gt;, PS3}
  Success : True
  Captures : {&lt;h2 class="ener"&gt;PS3 &lt;/h2&gt;}
  Index : 1864
  Length : 33
  Value : &lt;h2 class="ener"&gt;PS3 &lt;/h2&gt;
  </code></pre>
  
  <p>I can't workout a way to grab the second element of groups e.g. TV or PS3 as:</p>
  
  <p><code>$energenie.RawContent | select-string $regexname -AllMatches | % {$_.matches.groups}</code></p>
  
  <p>Gives a strange output</p>
  
  <p>Paul</p>