I've tried to wrap my head around this for quite a while, but still haven't found a solution.
I'm working on some simple way of formatting, where I want some tags containing strings inside brackets, with the tag defined right before the bracket. The tags should be able to be inside other brackets too.
String:
This is some random text, tag1{while this is inside a tag2{tag}}. This is some
other text tag2{also with a tag tag3{inside} of it}.
What I want to do now, is the content of each
tag1{}
tag2{}
tag3{}
I've found others with similar problems (Find matching brackets using regular expression) but their problem was more oriented on how to find matching brackets inside of other brackets, while my problem is both that, and finding multiply brackets in a longer text.