# Regexp route broken in Rails 2.2.2?

**URL:** <https://www.ruby-forum.com/t/regexp-route-broken-in-rails-2-2-2/159478>\
**Category:** Rails\
**Created:** [February 4, 2009, 10:25pm UTC](https://www.ruby-forum.com/t/regexp-route-broken-in-rails-2-2-2/159478 "2009-02-04T22:25:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ewildgoose](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bcef8e/32.png) [@ewildgoose](https://www.ruby-forum.com/u/ewildgoose)\
**Post date:** [February 4, 2009, 10:25pm UTC](https://www.ruby-forum.com/t/regexp-route-broken-in-rails-2-2-2/159478/1 "2009-02-04T22:25:09Z")

</div>

Hi, just upgraded an app from Rails 2.1.0 to 2.2.2 and finding my routes  
stopped working

URL which doesn’t match is:  
[http://blah/blog/auth/login](http://blah/blog/auth/login)

Route is:  
map.connect ‘blog/:controller/:action/:id’, :requirements =\>  
{:controller =\> /(auth|asdf)/}

In fact, neither does this match:  
map.connect ‘blog/:controller/:action/:id’, :requirements =\>  
{:controller =\> /(auth)/}

But this does:  
map.connect ‘blog/:controller/:action/:id’, :requirements =\>  
{:controller =\> /auth/}

So the problem seems to be that “( )” syntax is breaking the regexp  
parsing. Curiously though the regexp _does_ work for link generation,  
it’s only route recognition which breaks

Can anyone give me a quick workaround for this, quite a lot or routes to  
alter otherwise…

Thanks

Ed W
