title: Regex: Starting from a specific point on each line
body: <p>I have an HTML file that displays software installed on a machine, and I'd like to remove some of the cells in the table in the HTML file.
  Below is a sample of the code:</p>
  
  <pre><code>&lt;tr&gt;&lt;td&gt;Adobe Acrobat Reader DC&lt;/td&gt;&lt;td&gt;18.009.20050&lt;/td&gt;&lt;td&gt;20171130&lt;/td&gt;&lt;td&gt;kratos.kcprod1.com&lt;/td&gt;&lt;td&gt;4104917a-93f2-46e5-941a-c4efd54504b7&lt;/td&gt;&lt;td&gt;True&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;Adobe Flash Player 28 ActiveX&lt;/td&gt;&lt;td&gt;28.0.0.137&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;kratos.kcprod1.com&lt;/td&gt;&lt;td&gt;4104917a-93f2-46e5-941a-c4efd54504b7&lt;/td&gt;&lt;td&gt;True&lt;/td&gt;&lt;/tr&gt;
  </code></pre>
  
  <p>...and so on.</p>
  
  <p>What I'm trying to accomplish is to delete everything starting from the 4th instance of the td tag and stop just before the closing /tr tag on each line, so essentially eliminating...</p>
  
  <pre><code>&lt;td&gt;kratos.kcprod1.com&lt;/td&gt;&lt;td&gt;4104917a-93f2-46e5-941a-c4efd54504b7&lt;/td&gt;&lt;td&gt;True&lt;/td&gt;
  &lt;td&gt;kratos.kcprod1.com&lt;/td&gt;&lt;td&gt;4104917a-93f2-46e5-941a-c4efd54504b7&lt;/td&gt;&lt;td&gt;True&lt;/td&gt;
  </code></pre>
  
  <p>...so that I'm left with...</p>
  
  <pre><code>&lt;tr&gt;&lt;td&gt;Adobe Acrobat Reader DC&lt;/td&gt;&lt;td&gt;18.009.20050&lt;/td&gt;&lt;td&gt;20171130&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;Adobe Flash Player 28 ActiveX&lt;/td&gt;&lt;td&gt;28.0.0.137&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
  </code></pre>
  
  <p>The regex that I'm using is</p>
  
  <pre><code>(?&lt;=&lt;td&gt;)(.*)(?=&lt;\/tr&gt;)
  </code></pre>
  
  <p>The issue I'm having is that the above regex is selecting the enitre line of code. How can I change this so that it's starting from the 4th instance of the  tag for each line?</p>
  
  <p>Please see the following link with a full example of the HTML file I'm using and the regex applied: <a href="https://regex101.com/r/C9lkMc/3" rel="nofollow noreferrer">https://regex101.com/r/C9lkMc/3</a></p>
  
  <p><strong>EDIT 1:</strong> This HTML is generated from a PowerShell script to fetch installed software on remote machines. The code for that is:</p>
  
  <pre><code>    Invoke-Command -ComputerName $hostname -ScriptBlock {
      if (!([Diagnostics.Process]::GetCurrentProcess().Path -match '\\syswow64\\')) {
  
          $unistallPath = "\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
          $unistallWow6432Path = "\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\"
          @(
              if (Test-Path "HKLM:$unistallWow6432Path" ) { Get-ChildItem "HKLM:$unistallWow6432Path"}
              if (Test-Path "HKLM:$unistallPath" ) { Get-ChildItem "HKLM:$unistallPath" }
              if (Test-Path "HKCU:$unistallWow6432Path") { Get-ChildItem "HKCU:$unistallWow6432Path"}
              if (Test-Path "HKCU:$unistallPath" ) { Get-ChildItem "HKCU:$unistallPath" }
          ) |
              ForEach-Object { Get-ItemProperty $_.PSPath } |
              Where-Object {
              $_.DisplayName -and !$_.SystemComponent -and !$_.ReleaseType -and !$_.ParentKeyName -and ($_.UninstallString -or $_.NoRemove)
          } |
              Sort-Object DisplayName | Select-Object -Property DisplayName, DisplayVersion, InstallDate | ft
      }
  }
  </code></pre>