to_plain_segments(str)
this must be really fast
# File actionpack/lib/action_controller/routing/recognition_optimisation.rb, line 147 def to_plain_segments(str) str = str.dup str.sub!(/^\/+/,'') str.sub!(/\/+$/,'') segments = str.split(/\.[^\/]+\/+|\/+|\.[^\/]+\Z/) # cut off ".format" also segments << nil segments end