class ActionDispatch::Journey::Path::Pattern

def offsets

def offsets
  @offsets ||= begin
    offsets = [0]
    spec.find_all(&:symbol?).each do |node|
      node = node.to_sym
      if @requirements.key?(node)
        re = /#{Regexp.union(@requirements[node])}|/
        offsets.push((re.match("").length - 1) + offsets.last)
      else
        offsets << offsets.last
      end
    end
    offsets
  end
end