Is it possible to make a regular expression to match everything within single brackets but ignore double brackets, so for example in:
{foo} {bar} {{baz}}
In many languages you can use lookaround assertions:
(?
Explanation:
(?: previous character is not a {
{
\{([^}]+)\}
{foo}
(?!\})
}