title: Rails 3 Routing based on regex
body: <p>I want to redirect all routes that start with the string xyz to some other path.</p>
  
  <pre><code>match /\/xyz\/(.)*/ =&gt; redirect{ "whateverurl" }
  </code></pre>
  
  <p>The match method doesn't seem to work when given a regex, I have googled alot seems like there are options to do with regex but they are for params for example</p>
  
  <pre><code>match 'photos/:id' =&gt; 'photos#show', :constraints =&gt; { :id =&gt; /[A-Z]\d{5}/ }
  </code></pre>
  
  <p>How can I achieve it ?</p>