Your regular expression is working correctly. This is how Regex.Split() should behave (see document ). If what you said is really what you want, you can use something like:
var matches = from Match match in Regex.Matches(text, pattern) select match.Groups[1].Value;
If, on the other hand, you wanted to replace placeholders using some rules (for example, using Dictionary<string, string> ), you could do:
Regex.Replace(text, pattern, m => substitutions[m.Groups[1].Value]);
svick
source share