title: PowerShell regex -match only matching once
body: <p>I'm trying to run through files named using alphabetical dates, and set file date-times accordingly. My code works fine, and I was ready to consider it complete, when I noticed this issue. My code should detect two dates and generate an error, but it doesn't. I've extracted the relevant code, and recreated the issue:</p>
  
  <pre><code>$str = "test20001231 20170415.txt"
  $match = ($str -match "(?&lt;=\b|\D)20\d{6,6}(?=\b|\D)")
  "$match"
  "$($Matches.length)"
  "$($Matches[0].ToString())"
  </code></pre>
  
  <p>Gives this output:</p>
  
  <pre><code>True
  1
  20001231
  </code></pre>
  
  <p>My understanding of the regex code is that it should match everything that is an 8 digit number beginning with 20, wherever it is in the string, unless it is following or preceding another digit. So I am expecting $Matches.length to be 2.</p>
  
  <p>I've tested the regex code in a number of places online, and it matches the two dates as I expect: 
  <a href="http://regexstorm.net/tester?p=%28%3f%3c%3d%5cb%7c%5cD%2920%5cd%7b6%2c6%7d%28%3f%3d%5cb%7c%5cD%29&amp;i=test20001231+20170415.txt" rel="nofollow noreferrer">http://regexstorm.net/tester?p=%28%3f%3c%3d%5cb%7c%5cD%2920%5cd%7b6%2c6%7d%28%3f%3d%5cb%7c%5cD%29&amp;i=test20001231+20170415.txt</a>
  <a href="http://www.phpliveregex.com/p/jLA" rel="nofollow noreferrer">http://www.phpliveregex.com/p/jLA</a></p>
  
  <p>The issue applies to PS and PS ISE. I've searches lots (I think), and not turned up anything helpful.
  Any suggestions?
  Many thanks in advance,
  Dave</p>