I have this type of subtring
string 1
{
    string 2
    string 3
    {
        string 4
        string 5
    }
    string 6
    {
        string 7
        string 8
    }
    string 9
    {
        string 10
        string 11
        string 12
        {
            string 13
            string 14
        }
        string 15
    }
}
string 16
string 17
so basically i have java class type of structure
and now i want a piece of code which can get me following substrings(SS#)
SS1:
        string 4
        string 5
SS2:
        string 7
        string 8
SS3:
            string 13
            string 14
SS4:
string 16
string 17
SS5:
        string 10
        string 11
        string 12
        {
            string 13
            string 14
        }
        string 15
SS6:
    string 2
    string 3
    {
        string 4
        string 5
    }
    string 6
    {
        string 7
        string 8
    }
    string 9
    {
        string 10
        string 11
        string 12
        {
            string 13
            string 14
        }
        string 15
    }
so basically i want a piece of code that can get me various parts(function, classes, but not any loops) of string(java class) into different substrings...
i read this
Regex to get string between curly braces "{I want what's between the curly braces}"
but it only gets me data between a pair of '{', and '}' without counting the '{' that have come after the first.
i don't the full code, but some direction into how to proceed???
 
     
     
     
     
    