I an trying to replace the text within pairs of braces { in strings that contain sets of braces. The replacement text depends on the current contents of the braces
{