# Parsing string with nested information

I am trying to parse a string, but I have no idea how to solve the following problem

problem = "a { b { c d } e } aa { bb cc }";
answer = {{"a", "b", "c"}, {"a", "b", "d"}, {"a", "e"}, {"aa", "bb"}, {"aa", "cc"}};


So the answer is a path in each sub-list of the list

Any suggestions ?

• can you please enter the problem is Mathematica synatx? Is the problem meant to be: problem = a { b { c d } e } a a { b b c c } ? I do not understand what path node list of the tree information here. You mean TreeForm ? can you give a link that explains what it is? – Nasser Jan 17 '15 at 9:02
• now modified. sorry for ambiguity. – marsiano Jan 17 '15 at 9:08

problem = "a { b { c d } e } aa { bb cc }";