class ActiveSupport::Cache::Store

def key_matcher(pattern, options)

matches namespaced keys.
this method to translate a pattern that matches names into one that
match keys. Implementations that support delete_matched should call
Add the namespace defined in the options to a pattern designed to
def key_matcher(pattern, options)
  prefix = options[:namespace].is_a?(Proc) ? options[:namespace].call : options[:namespace]
  if prefix
    source = pattern.source
    if source.start_with?('^')
      source = source[1, source.length]
    else
      source = ".*#{source[0, source.length]}"
    end
    Regexp.new("^#{Regexp.escape(prefix)}:#{source}", pattern.options)
  else
    pattern
  end
end