title: Rails 3 routing constraints don't seem to be matching the regex properly
body: <p>I am using Rails 3.0.5 and I have setup a route using a regex constraint. It used to work on Rails 2.3.5, but it's not working in Rails 3. The route looks like this:</p>
  
  <pre><code>get '/:version_id' =&gt; 'pastes#show', :constraints =&gt; { :version_id =&gt; /[\d\w]{40}/ }
  </code></pre>
  
  <p>It doesn't work at all. However, the following work:</p>
  
  <pre><code>get '/:version_id' =&gt; 'pastes#show', :constraints =&gt; { :version_id =&gt; /.{40}/ }
  
  get '/:version_id' =&gt; 'pastes#show', :constraints =&gt; { :version_id =&gt; /\w{40}/ }
  
  get '/:version_id' =&gt; 'pastes#show'
  </code></pre>
  
  <p>Is there something wrong with the way Rails handles [ ] matching? or am I doing something wrong?</p>
  
  <p>version_id usually looks something like this: </p>
  
  <pre><code>816616001d7ce848944a9e0d71a5a22d3b546943
  </code></pre>