木、子→親
tree = [[ (Root (Spine (Neck (Head)) (RClavicle (RUpperArm (RLowerArm (RHand)))) (LClavicle (LUpperArm (LLowerArm (LHand))))) (RHip (RUpperLeg (RLowerLeg (RFoot)))) (LHip (LUpperLeg (LLowerLeg (LFoot))))) ]] while true do s, e, n = tree:find(' %((%a+)', e) if not n then break end print(n..' . '..tree:sub(1, s):gsub('%b()', ''):match'(%a+)%s*$') end