using System.Text.RegularExpressions;
public static void Main()
string data = "rae*sfe*que(aa+abc)*fed(bb+agh(fd-fg-gh(ty-tu)))*rtd(cc+dfg+fgd+hjk+fgh(vbn/dcv)";
string regex = @"\(+.*?\)+";
var matches = Regex.Matches(data, regex, RegexOptions.Multiline);
foreach(Match item in matches)
var level0 = Regex.Replace(data, regex, string.Empty);
matches = Regex.Matches(level0, @"\w+", RegexOptions.Multiline);
foreach(Match item in matches)
if(string.IsNullOrEmpty(level0))
level0 += item.Groups[0];
level0 += "," + item.Groups[0];
Console.WriteLine(level0);