I have a text file and I am using Powershell to list out the names present in the below pattern
Contents of the file:
beta-clickstream-class="owner:"mike""
beta-clickstream-class="owner:"kelly""
beta-clickstream-class="owner:"sam""
beta-clickstream-class="owner:"joe""
beta-clickstream-class="owner:"john""
beta-clickstream-class="owner:"tam""
Output I am looking for
mike
kelly
sam
joe
john
tam
Script I am using is
$importPath = "test.txt"
$pattern = 'beta-clickstream-class="owner:"(.*?)""'
$string = Get-Content $importPath
$result = [regex]::match($string, $pattern).Groups[1].Value
$result
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.