From: Gregory Seidman Date: 2007-01-30T03:28:47+09:00 Subject: Re: Named groups in regexp matches? On Tue, Jan 30, 2007 at 03:24:40AM +0900, Tom Pollard wrote: > Hi, > > Does Ruby support regexps that assign names to specific matched > groups? In Python, for instance, if you write a regexp like this, > > TEMP_RE = re.compile(r"""^(?P(M|-)?\d+|//|XX|MM)/ > (?P(M|-)?\d+|//|XX|MM)?\s+""", > re.VERBOSE) > > the match object will provide a hash with keys 'temp' and 'dewpt', [...] Take a look at this thread: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/80270 > Thanks, > Tom --Greg