From: Trans Date: 2005-04-21T02:14:35+09:00 Subject: Re: Linear complete variation of MatchData#to_a, possible? Hi Capitain-- Pit Capitain wrote: > Do you really think that you want this nesting? I'd expect something like > > [ "0", [ [ "1" ], [ "2", [ "3" ] ], [ "4" ] ], "5" ] > > Could you try to specify the rules for your desired nesting and > splitting? I think it should be possible to implement something like this. Your nesting will work too. I excluded a couple layers were I felt it wasn't significant. I think the pre and post matches can just be the first and last elements respectively, so another that nesting isn't relly needed (IMHO). But you may be quite right about the next layer. I had thought it might be dropped without issue, but perhaps it is in fact neccessary to keep the nesting consistant with the subexpressions. Nonetheless, yes, you have the idea. Can it be done? I'm not sure how one would "query" the level of subexpression nesting. Thanks, T.