From: Austin Ziegler Date: 2003-08-27T04:37:42+09:00 Subject: Re: Named matches for regular expressions (was: Re: Specification of Ruby regex?) On Wed, 27 Aug 2003 04:29:22 +0900, Wesley J. Landaker wrote: > Apparently, Austin Ziegler recently wrote: >> On Tue, 26 Aug 2003 21:28:07 +0900, 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)? >>> I'm 99.99% sure it doesn't. >> The latest Oniguruma supports it. I'm not sure how to use/enable that, >> but it does support it. No. See [ruby-talk:79047] and following. ----------- [ruby-dev:21147] [Oniguruma] list of all captures [ruby-dev:21174] [Oniguruma] Version 1.9.2 TANAKA Akira suggested a new function, to capture all matchings for the one expression. e.g. m = /(?@\/\w+)+/.match("/usr/local/bin/ruby") p m['name'] #=> ["/usr", "/local", "/bin", "/ruby"] ----------- -austin -- austin ziegler * austin@halostatue.ca * Toronto, ON, Canada software designer * pragmatic programmer * 2003.08.26 * 15.35.20