using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.RegularExpressions; public class Test { public static void Main() { var text = "[Name1]|20|[Nam|2]|{Na;me,3}|50|[Na|me!@#$%^&*()Finish]|[25]|{67}"; var pattern = @"\[(?[^][]*)]|\{(?[^{}]*)}|(?[^|]+)"; var result = Regex.Matches(text, pattern).Cast().Select(x => x.Groups["r"].Value); foreach (var s in result) Console.WriteLine(s); } }