From: Robert Klemme Date: 2007-07-13T23:45:52+09:00 Subject: Re: Regexp Question - Merb::Router 2007/7/13, James Edward Gray II : > On Jul 13, 2007, at 3:12 AM, Daniel N wrote: > > > /(?::([a-z*_]+))/ > > > > I guess this means that a nested group within this non capturing > > group (this > > case) is captured though since the $1 variable is refered to later. > > Yes. The part without the colon is capture, because of the normal > parenthesis. > > Unless this expression is later embedded in another expression, the > non-capturing group does nothing here and could safely be removed. Even in that case the grouping can be removed: irb(main):002:0> /foo/.to_s => "(?-mix:foo)" irb(main):003:0> /(?:foo)/.to_s => "(?-mix:foo)" Kind regards robert