Simple C# Tokenizer Using Regex
- by Pete
I'm looking to tokenize really simple strings,but struggling to get the right Regex.
The strings might look like this:
string1 = "{[Surname]}, some text... {[FirstName]}"
string2 = "{Item}foo.{Item2}bar"
And I want to extract the tokens in the curly braces (so string1 gets "{[Surname]}","{[FirstName]}" and string2 gets "{Item}" and "{Item2}")
this question is quite good, but I can't get the regex right:
poor mans lexer for c#
Thanks for the help!