Lets say I have following string:
\"
<
You're trying to deal with balanced set of braces. This requires recursive regular expressions. By definition, recursive regexes are not regular. Anyway, some languages support them, e.g. Perl, PHP, ruby. This is a good tutorial on the topic.
Generally, you should extract this kind of information with a fully-fledged parser, like yacc.
This is a regex that can deal with the non-balanced braces: ([ =]*)=(\{[^}]*\})
. This will match {
and {st}
which is correct. Unfortunately, it will match {