I'm trying to split a string in java based on brackets with the possibility that there are nested brackets, example:
"{one two {three}}{one {two} {{three}}}"
what I would like to get is an array with
array [0] = {one two {three}}
array [1] = {one {two} {{three}}}
I tried using the \ {(. *?) \}
Regex but I get substrings like
{one two {Three}
which do not take into account which is the correct closing parenthesis
How can I do it?