title: Looping through Regex Matches
body: <p>This is my source string:</p>
  
  <pre><code>&lt;box&gt;&lt;3&gt;
  &lt;table&gt;&lt;1&gt;
  &lt;chair&gt;&lt;8&gt;
  </code></pre>
  
  <p>This is my Regex Patern:</p>
  
  <pre><code>&lt;(?&lt;item&gt;\w+?)&gt;&lt;(?&lt;count&gt;\d+?)&gt;
  </code></pre>
  
  <p>This is my Item class</p>
  
  <pre><code>class Item
  {
      string Name;
      int count;
      //(...)
  }
  </code></pre>
  
  <p>This is my Item Collection;</p>
  
  <pre><code>List&lt;Item&gt; OrderList = new List(Item);
  </code></pre>
  
  <p>I want to populate that list with Item's based on source string.
  This is my function. It's not working.</p>
  
  <pre><code>Regex ItemRegex = new Regex(@"&lt;(?&lt;item&gt;\w+?)&gt;&lt;(?&lt;count&gt;\d+?)&gt;", RegexOptions.Compiled);
              foreach (Match ItemMatch in ItemRegex.Matches(sourceString))
              {
                  Item temp = new Item(ItemMatch.Groups["item"].ToString(), int.Parse(ItemMatch.Groups["count"].ToString()));
                  OrderList.Add(temp);
              }
  </code></pre>
  
  <p>Threre might be some small mistakes like missing letter it this example because this is easier version of what I have in my app.</p>
  
  <p>The problem is that In the end I have only one Item in OrderList.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I got it working.
  Thans for help.</p>