using System.Text.RegularExpressions;
public static void Main()
string input = "This {is} a {test}...";
string output = Test(input);
Console.WriteLine(output);
private static readonly Regex Pattern = new Regex("{(.+?)}", RegexOptions.Compiled);
public static string Test(string input)
return Pattern.Replace(input, match =>
string newMatch = match.Groups[1].Value;
return ">> " + newMatch + " <<";