From: Randy Kramer Date: 2005-04-04T00:53:00+09:00 Subject: Re: Iterating through a string and removing leading characters On Sunday 03 April 2005 10:16 am, Saynatkari wrote: > Le 3/4/2005, "Randy Kramer" a �crit: > >But, instead of (or maybe in addition to) returning the "Aah", "Bay" in > > $2, $4 or whatever, how about returning an integer (somehow) that > > indicates which one matched? > > I mentioned this a while ago; I edited my strscan.c to provide > methods #matched_groups and #first_matched_group for accessing > this information (I used it to dispatch a block to process a > particular type of match). I can clean it up and post a patch > somewhere if it seems a useful feature for other people. Thanks, I might take you up on that offer, but I'll be busy for 2 to 4 weeks with some other things. After I get back into parsing, I'll get back to you. (I'm not much at patching, and I'd hate to ask you to do something if I wasn't fairly certain I'd be able to use it. Still, if others see use for it ...) regards, Randy Kramer