I'd like to have one regular expression to find all curly brackets and replace them with other strings.
For example, I want to replace "{foo}" with "FOO" and "{bar}" with "BAR" and "{}" with "EMPTY". If the input is "abc {foo} def {bar} {}", then the output is "abc FOO def BAR EMPTY".
Nested brackets or un-coupled brackets are not allowed. If character "{" or "}" is necessary. It should be doubled. So, "{{ def }}" is just "{ def }".
Other string in {} is not allowed. Say, I just want "{foo}" and "{bar}". So, "abc {xyz} def" should be recognized as invalid input.