title: PowerShell Select-String from file with Regex
body: <p>I am trying to get a string of text from a .sln (Visual Studio solution file) to show what project files are contained within the solution.</p>
  
  <p>An example line of text is</p>
  
  <blockquote>
    <p>Project("{xxxx-xxxxx-xxxx-xxxx-xx}") = "partofname.Genesis.Printing", "Production\partofname.Genesis.Printing\partofname.Genesis.Printing.csproj", "{xxx-xxx-xxx-xxx-xxxx}"
    EndProject</p>
  </blockquote>
  
  <p>The part of the string that I am interested in is the last part between the <code>\</code> and the <code>"</code>.</p>
  
  <p>\partofname.Genesis.Printing.csproj"</p>
  
  <p>The regular expression I am using is:</p>
  
  <pre><code>$r = [regex] "^[\\]{1}([A-Za-z.]*)[\""]{1}$"
  </code></pre>
  
  <p>I am reading the file content with:</p>
  
  <pre><code>$sln = gci .\Product\solutionName.sln
  </code></pre>
  
  <p>I don't know what to put in my string-select statement.</p>
  
  <p>I am very new to PowerShell and would appreciate any and all help...</p>
  
  <p>I did have a very very long-hand way of doing this earlier, but I have lost the work... Essentially it was doing this for each line in a file:</p>
  
  <pre><code>Select-String $sln -pattern 'proj"' | ? {$_.split()}
  </code></pre>
  
  <p>But a regular expression would be a lot easier (I hope).</p>