?: is used inside parentheses to indicate that they shouldn't be used as a match group. The second colon is used here as a literal.
On Jul 13, 2007, at 2:22 AM, Daniel N wrote: > Hi, > > I'm looking through the Merb::Routing code and I've found a regexp > that I can't figure out how it works. > > Merb::Router::SECTION_REGEXP #=> /(?::([a-z*_]+))/ > > It takes a route definition string, like "/products/:model/:id" > and extracts the "model" string on the first pass, and later the > "id" string. > > Can anyone shed some light on what the > ?:: > part does? I haven't found it in any of the documentation for Ruby > Regexps that I've found. > > Cheers > Daniel > > _______________________________________________ > Merb-devel mailing list > [email protected] > http://rubyforge.org/mailman/listinfo/merb-devel _______________________________________________ Merb-devel mailing list [email protected] http://rubyforge.org/mailman/listinfo/merb-devel
