title: Parse labeled param strings with Regex
body: <p>Can anyone help me with this one?  </p>
  
  <p>My objective here is to grab some info from a text file, present the user with it and ask for values to replace that info so to generate a new output. So I thought of using regular expressions.</p>
  
  <p>My variables would be of the format: <code>{@&lt;num&gt;[|&lt;value&gt;]}</code>.</p>
  
  <p>Here are some examples:  </p>
  
  <pre><code>{@1}&lt;br&gt;
  {@2|label}&lt;br&gt;
  {@3|label|help}&lt;br&gt;
  {@4|label|help|something else}&lt;br&gt;&lt;br&gt;
  </code></pre>
  
  <p>So after some research and experimenting, I came up with this expression: <code>\{\@(\d{1,})(?:\|{1}(.+))*\}</code></p>
  
  <p>which works pretty well on most of the ocasions, except when on something like this:</p>
  
  <pre><code>{@1} some text {@2|label} some more text {@3|label|help}
  </code></pre>
  
  <p>In this case variables 2 &amp; 3 are matched on a single occurrence rather than on 2 separate matches...</p>
  
  <p>I've already tried to use lookahead commands for the trailing <code>}</code> of the expression, but I didn't manage to get it.</p>
  
  <p>I'm targeting this expression for using into C#, should that further help anyone...</p>