But then, the routing for URL "/apple" works but "/APPLE" does not!
Because Rails doesn't use the regular expression as-is. It decides that
you always want the expression to be anchored at the start and end. The
code used is:
requirement_conditions = requirements.collect do |key, req|
if req.is_a? Regexp
value_regexp = Regexp.new "\\A#{req.source}\\Z"
So only the source string of your regular expression is used.