title: powershell regular expressions
body: <p>quick one:</p>
  
  <pre><code>$logFile="D:\Code\functest\1725.log"
  function getTime($pattern) {
    Get-Content $logFile | %{ if ($_.Split('\t') -match $pattern) {$_} }
  }
  getTime("code")
  </code></pre>
  
  <p>gives me </p>
  
  <pre><code>simple  17-Feb-2011 10:45:27    Updating source code to revision: 49285
  simple  17-Feb-2011 10:54:22    Updated source code to revision: 49285
  </code></pre>
  
  <p>but if I change the print value from</p>
  
  <pre><code>$_
  </code></pre>
  
  <p>to</p>
  
  <pre><code>$matches
  </code></pre>
  
  <p>I get nothing. I thought this array should have been created automatically? probably something silly, but this is my first day of using powershell :-)</p>
  
  <p><strong>EDIT:</strong> what I want to return is </p>
  
  <pre><code>Get-Date (column 2 of the matching line)
  </code></pre>