title: Parsing strings recursively
body: <p>I am trying to extract information out of a string - a fortran formatting string to be specific. The string is formatted like:</p>
  
  <pre><code>F8.3, I5, 3(5X, 2(A20,F10.3)), 'XXX'
  </code></pre>
  
  <p>with formatting fields delimited by "," and formatting groups inside brackets, with the number in front of the brackets indicating how many consecutive times the formatting pattern is repeated. So, the string above expands to:</p>
  
  <pre><code>F8.3, I5, 5X, A20,F10.3, A20,F10.3, 5X, A20,F10.3, A20,F10.3, 5X, A20,F10.3, A20,F10.3, 'XXX'
  </code></pre>
  
  <p>I am trying to make something in C# that will expand a string that conforms to that pattern. I have started going about it with lots of switch and if statements, but am wondering if I am not going about it the wrong way? </p>
  
  <p>I was basically wondering if some Regex wizzard thinks that Regular expressions can do this in one neat-fell swoop? I know nothing about regular expressions, but if this could solve my problem I am considering putting in some time to learn how to use them... on the other hand if regular expressions can't sort this out then I'd rather spend my time looking at another method.</p>