# File lib/rhc/rest/application.rb, line 322
      def find_cartridges(name, options={})
        if name.is_a?(Hash)
          options = name
          name = options[:name]
        end

        type = options[:type]
        regex = options[:regex]
        debug "Finding cartridge #{name || regex} in app #{@name}"

        filtered = Array.new
        cartridges.each do |cart|
          if regex
            filtered.push(cart) if cart.name.match(/(?i:#{regex})/) and (type.nil? or cart.type == type)
          else
            filtered.push(cart) if cart.name.downcase == name.downcase and (type.nil? or cart.type == type)
          end
        end
        filtered
      end