Rails 3 constraints, named routes and form_tag

I have the following URL I match to show a subset of text from a book


I have a route definition that works perfectly when entering a url in
the browser however I cannot get a link_to or path name for this url

  match '/:book/:chapter1/:line1/:chapter2/:line2',
    :to => "lines#showlines",
    :constraints => {
      :book => /\d*\s?\w{2,}/,
      :chapter1 => /\d+/,
      :line1 => /\d+/,
      :chapter2 => /\d+/,
      :line2 => /\d+/ },
      :as => :showlines

I keep getting the error
No route matches
{:chapter1=>"1", :verse1=>"1", :controller=>"verses", :chapter2=>"1", :action=>"showverses", :verse2=>"3", :book=>"john"}

I have tried

<%=h link_to("link",

This is Rails 3.

Any pointers?


What I am trying to do is create a form to select a location in the
book and then render it.


OK - at least I have a workaround....

removing the constraints allows link_to, etc to work. However, I have
to deal with checking for properly formatted URL's in the controller.