# Routing question

**URL:** <https://www.ruby-forum.com/t/routing-question/104719>\
**Category:** Rails\
**Created:** [May 21, 2007, 9:12pm UTC](https://www.ruby-forum.com/t/routing-question/104719 "2007-05-21T21:12:55Z")\
**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, 9:12pm UTC](https://www.ruby-forum.com/t/routing-question/104719/1 "2007-05-21T21:12:55Z")

</div>

In routing.rb, what is the purpose of the following piece of code:

class Regexp  
def number\_of\_captures  
Regexp.new("|#{source}").match(’’).captures.length  
end

Does this method not always return 0? It’s always going to match ‘’  
with the blank spot before the | and therefore will have no captures.
