Forum: Ruby on Rails Rails Routing - what's this do?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B29827838126aaaf080325b3f241e496?d=identicon&s=25 RailsToPerl (Guest)
on 2007-05-21 20:58
(Received via mailing list)
Does anyone know what the point of the following bit of code (from
routing.rb) does?

class Regexp #:nodoc:
  def number_of_captures
    Regexp.new("|#{source}").match('').captures.length
  end
end

Does this not always return 0, since there are no captures when
matching '' to ''?
This topic is locked and can not be replied to.