From: Mark Slagell Date: 2003-08-26T21:56:39+09:00 Subject: Re: Specification of Ruby regex? Gavin Sinclair wrote: > On Tuesday, August 26, 2003, 10:18:24 PM, Emmanuel wrote: > > >>btw, since there is a thread about that, i wanted to ask: >>does ruby support named matches (sorry i don't know the proper terminology)? >>C# does it like this: >>"(?\d{4})-(?\d{1,2})-(?\d{1,2})" > > >>matches "2002-4-6" >>and then in my match groups i have "year", "month", "day". > > >>(looked in pickaxe + google ruby "regexp match group") > > > I'm 99.99% sure it doesn't. > > Gavin > > > Is this helpful at all? year, month, day = /(\d{4})-(\d{1,2})-(\d{1,2})/.match(s).to_a (where s is the string to be matched)