Using a regular expression to parse an expression which contains the same expression e.g. `{ foo bar {zoo} }`
A recursive expression is an expression which contains the same expression, e.g. { foo bar {zoo} }
contains an expression {...}
which contains an expression {...}
. Such expressions are typically expressed using a Context-free language.
However, a regular expression is only capable to parse an expression which uses a Regular Grammar.
Thus, this tag suggests that a user wants to parse a recursive expression using a regular expression, which is not possible. Typically, the user knows regular expressions, but is not really aware of the limitations, so it asks the SO community.
There is no unique solution to that problem since it depends on the grammar of the expression to parse (e.g. the user may want to limit the recursion levels).
Recursive expressions should not be confused with repeated expressions (e.g. {foo} {bar} {zoo}
) which can be parsed using regular expressions.