title: Parsing formatted string
body: <p>I am trying to create a generic formatter/parser combination.</p>
  
  <p>Example scenario:</p>
  
  <ul>
  <li>I have a string for string.Format(), e.g. <code>var format = "{0}-{1}"</code></li>
  <li>I have an array of object (string) for the input, e.g. <code>var arr = new[] { "asdf", "qwer" }</code></li>
  <li>I am formatting the array using the format string, e.g. <code>var res = string.Format(format, arr)</code></li>
  </ul>
  
  <p>What I am trying to do is to revert back the formatted string back into the array of object (string). Something like (pseudo code):</p>
  
  <pre><code>var arr2 = string.Unformat(format, res)
  
  // when: res = "asdf-qwer"    
  // arr2 should be equal to arr
  </code></pre>
  
  <p>Anyone have experience doing something like this? I'm thinking about using regular expressions (modify the original format string, and then pass it to Regex.Matches to get the array) and run it for each placeholder in the format string. Is this feasible or is there any other more efficient solution?</p>