using System.Text.RegularExpressions;
public static void Main()
string preferedName = "Empty (5) Preset";
Match match = Pattern.Match(preferedName);
index = Int32.Parse(match.Groups[2].Value) + 1;
preferedName = match.Groups[1].Value + "({0})" + match.Groups[3].Value;
preferedName += " ({0})";
Console.WriteLine(preferedName);
Console.WriteLine(index);
private static readonly Regex Pattern = new Regex(@"(.*)\((\d+)\)(.*)", RegexOptions.Compiled);