title: C# Regex Expression for a repeated pattern
body: <p>I need to craft a complex regex expression that will match a varying number of repeating patterns in a string..</p>
  
  <p>An example of the string to match would be as follows</p>
  
  <pre><code>1\(E_123456)\(E_34567)\(E_424324234)\(E_8908908)\(E_23132312)\M_133123 
  </code></pre>
  
  <p>I have added the parentheses to highlight the repeating patterns I would need to match. These would not be present in the real string.</p>
  
  <p>The order is important as it describes a certain hierarchy. It is this hierarchy I would be looking to extract and construct. The depth of the pattern (or number of repeating patterns) would not be constant at all so it's not a simple case of x number of groups! </p>
  
  <p>ie.. the above has a depth of 5 </p>
  
  <p>E_123456, E_34567, E_424324234, E_8908908, E_23132312</p>
  
  <p>while </p>
  
  <pre><code>1\(E_1)\(E_11111)\(E_354534534)\M_133123 
  </code></pre>
  
  <p>would have a depth of three. (E_1, E_111111, E_354534534)</p>
  
  <p>However I need a regex that will output an ordered list in the order that these values are presented regardless of the depth... </p>
  
  <p>I'm ok with basic regex expressions but they are not my forte so someone's help will be hugely appreciated!</p>