title: How to get all possible regex matches in a string
body: <p>I am attempting to write a program that will look for series of numbers in a string that could be interpreted as dates. To that end, I have written a regular expression which I run like this:</p>
  
  <pre><code>Dim m As MatchCollection = Regex.Matches(_string, "[0-9]{1,4}[-_ ]?[0-9]{1,2}([-_ ]?[0-9]{2,4})?")
  </code></pre>
  
  <p>Now, when I give it some weird string like "4_2_2012_13_39", I would expect it to return the following nine matches:</p>
  
  <ol>
  <li>4_2</li>
  <li>4_2_20</li>
  <li>4_2_2012</li>
  <li>2_20</li>
  <li>2012</li>
  <li>2012_13_39</li>
  <li>12_13</li>
  <li>12_13_39</li>
  <li>13_39</li>
  </ol>
  
  <p>(I have a secondary step that would discard numbers 6 and 9 for not having any number in the range for a month value.) In fact, I get only two matches: "4_20_2012" and "13_39". I think it's trying not to use the same character in two matches. Is there a way that I can insist that it not do so? Thank you for any help.</p>
  
  <p>Rob</p>