title: Using Powershell to match a pattern on all occurrences in a text file
body: <p>I have a text file and I am using Powershell to list out the names present in the below pattern</p>
  
  <p>Contents of the file:</p>
  
  <pre><code>beta-clickstream-class="owner:&amp;quot;mike&amp;quot;"
  beta-clickstream-class="owner:&amp;quot;kelly&amp;quot;"
  beta-clickstream-class="owner:&amp;quot;sam&amp;quot;"
  beta-clickstream-class="owner:&amp;quot;joe&amp;quot;"
  beta-clickstream-class="owner:&amp;quot;john&amp;quot;"
  beta-clickstream-class="owner:&amp;quot;tam&amp;quot;"
  </code></pre>
  
  <p>Output I am looking for</p>
  
  <pre><code>mike
  kelly
  sam
  joe
  john
  tam
  </code></pre>
  
  <p>Script I am using is </p>
  
  <pre><code>$importPath = "test.txt"
  $pattern = 'beta-clickstream-class="owner:&amp;quot;(.*?)&amp;quot;"'
  $string = Get-Content $importPath
  $result = [regex]::match($string, $pattern).Groups[1].Value
  $result
  </code></pre>
  
  <p>Above script is only listing the first name on the file. Can you please guide me on how to list all the names on the file.</p>