Tag Info

New answers tagged

3

I may have misunderstood the requirement but this seems to work for the example at least: problem = "a { b { c d } e } aa { bb cc }"; Map[Flatten, StringSplit[problem] //. {head___, x_, "{", Shortest[y__], "}", tail___} :> {head, Sequence @@ Thread[{x, {y}}], tail}] (* {{"a", "b", "c"}, {"a", "b", "d"}, {"a", "e"}, {"aa", "bb"}, {"aa", "cc"}} *)



Top 50 recent answers are included