title: Simple C# Tokenizer Using Regex
body: <p>I'm looking to tokenize really simple strings,but struggling to get the right Regex.</p>
  
  <p>The strings might look like this:</p>
  
  <pre><code>string1 = "{[Surname]}, some text... {[FirstName]}"
  
  string2 = "{Item}foo.{Item2}bar"
  </code></pre>
  
  <p>And I want to extract the tokens in the curly braces (so string1 gets <code>"{[Surname]}","{[FirstName]}"</code> and string2 gets <code>"{Item}"</code> and <code>"{Item2}"</code>)</p>
  
  <p>So basically, there's two different token types I want to extract: {[Foo]} and {Bar}.</p>
  
  <p>this question is quite good, but I can't get the regex right: 
  <a href="https://stackoverflow.com/questions/673113/poor-mans-lexer-for-c">poor mans lexer for c#</a>
  Thanks for the help!</p>