# Rails Routing - what's this do?

**URL:** <https://www.ruby-forum.com/t/rails-routing-whats-this-do/104717>\
**Category:** Rails\
**Created:** [May 21, 2007, 8:58pm UTC](https://www.ruby-forum.com/t/rails-routing-whats-this-do/104717 "2007-05-21T20:58:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RailsToPerl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a5b964/32.png) [@RailsToPerl](https://www.ruby-forum.com/u/RailsToPerl)\
**Post date:** [May 21, 2007, 8:58pm UTC](https://www.ruby-forum.com/t/rails-routing-whats-this-do/104717/1 "2007-05-21T20:58:53Z")

</div>

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 ‘’?
