get the keys who's value matches the pattern

@param cacheConfigBean the data source of the cache
@param pattern         the pattern
@return the keys
425642
@SuppressWarnings("unchecked")
    public static Single<Set<String>> keys(CacheConfigBean cacheConfigBean, String pattern) {
        return SingleRxXian.call(CacheService.CACHE_SERVICE, "cacheKeys", new JSONObject() {{
            put("cacheConfig", cacheConfigBean);
            put("pattern", pattern);
        }}).map(response -> {
            response.throwExceptionIfNotSuccess();
            if (response.getData() instanceof Set) {
                return (Set<String>) response.getData();
            } else
                return new HashSet<String>() {{
                    addAll(response.dataToTypedList(String.class));
                }};
        });
    }
995272
public static final String convertPattern(String pattern) {
        if (pattern == null) {
            return null;
        }
        else {
            String convertedPattern = pattern;
            for (PatternConverter converter : PATTERN_CONVERTERS) {
                convertedPattern = converter.convert(convertedPattern);
            }

            return convertedPattern;
        }
    }
605878
@Trivial
    public static DCache getCache(String cacheName) {

        final String methodName = "getCache()";
        DCache cacheOut = ServerCache.cache;

        if (cacheName != null) {
            cacheName = normalizeCacheName(cacheName, null);
        }

        if (cacheName != null && !cacheName.equalsIgnoreCase(DCacheBase.DEFAULT_CACHE_NAME)) {
            cacheOut = cacheInstances.get(cacheName);
        }

        if (cacheOut == null && TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName + " could not find cache for cacheName=" + cacheName);
        }

        return cacheOut;
    }
1017768
public Criteria regex(Pattern pattern) {
        notNull(pattern, "pattern can not be null");
        this.criteriaType = RelationalOperator.REGEX;
        this.right = ValueNode.toValueNode(pattern);
        return this;
    }
806381
public static <T> Single<Set<T>> values(String key, Class<T> vClazz) {
        return values(CacheService.CACHE_CONFIG_BEAN, key, vClazz);
    }
881509
def keys(pattern='*', host=None, port=None, db=None, password=None):
    '''
    
    '''
    server = _connect(host, port, db, password)
    return server.keys(pattern)
79927
public static Pattern pattern(AbstractConfig config, String key) {
    String pattern = config.getString(key);

    try {
      return Pattern.compile(pattern);
    } catch (PatternSyntaxException e) {
      throw new ConfigException(
          key,
          pattern,
          String.format(
              "Could not compile regex '%s'.",
              pattern
          )
      );
    }
  }
439824
@Trivial
    public static String normalizeCacheName(String cacheName, CacheConfig cacheConfig) {

        String tempCacheName = cacheName;

        if (cacheName.equalsIgnoreCase(DCacheBase.DEFAULT_BASE_JNDI_NAME)) {
            tempCacheName = DCacheBase.DEFAULT_CACHE_NAME;

        } else if (cacheName.equalsIgnoreCase(DCacheBase.DEFAULT_DMAP_JNDI_NAME)) {
            tempCacheName = DCacheBase.DEFAULT_DISTRIBUTED_MAP_NAME;
        }

        // Make sure the input cacheName matched with cacheConfig's cacheName.
        // If not match, set to the input cacheName for cacheConfig
        if (null != cacheConfig && !tempCacheName.equals(cacheConfig.cacheName)) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "normalized cacheName=" + cacheName + " does not match with cacheConfig cacheName=" + cacheConfig.cacheName);
            }
            cacheConfig.cacheName = tempCacheName;
        }

        return tempCacheName;
    }
488351
public function keys($pattern)
    {
        $this->seeks++;
        if ($this->detailedLogging) {
            \common_Logger::w('Call for '.$key.' ('.$call.')');
        }
        return $this->persistence->keys($pattern);
    }
864832
function getChannels(pattern) {
  if(!pattern) return Object.keys(this._channels);
  var re = (pattern instanceof RegExp) ? pattern : Pattern.compile(pattern)
    , k
    , list = [];
  for(k in this._channels) {
    if(re.test(k)) {
      list.push(k);
    }
  }
  return list;
}
529175
public MarcField matchValue(Pattern pattern) {
        if (value != null && pattern.matcher(value).matches()) {
            return this;
        }
        for (Subfield subfield : subfields) {
            if (pattern.matcher(subfield.getValue()).matches()) {
                return this;
            }
        }
        return null;
    }
903028
public List<M> findByCache(String cacheName, Object key, String sql, Object... paras) {
		Config config = _getConfig();
		ICache cache = config.getCache();
		List<M> result = cache.get(cacheName, key);
		if (result == null) {
			result = find(config, sql, paras);
			cache.put(cacheName, key, result);
		}
		return result;
	}
6865
@Override
    public String[] getCacheIDsOnDisk(String cacheInstance, String pattern) throws javax.management.AttributeNotFoundException {

        // Get the cache for this cacheInstance
        DCache cache1 = getCache(cacheInstance);

        //Throw exception if disk caching is not enabled.  
        if (!cache1.getSwapToDisk()) {
            Tr.error(tc, "DYNA1051E", new Object[] { "getCacheIDsOnDisk", cacheInstance });
            throw new AttributeNotFoundException("Disk caching is not enabled.");
        }
        // Check that the input pattern is a valid regular expression
        Pattern cpattern = checkPattern(pattern);

        List<String> matchSet = new ArrayList<String>(10);
        if (cache1.getIdsSizeDisk() > 0) {
            int index = 0;
            boolean more = false;

            do {

                more = false;
                Collection diskSet = cache1.getIdsByRangeDisk(index, 100);
                if (diskSet != null) {
                    if (true == diskSet.contains(HTODDynacache.DISKCACHE_MORE)) {
                        more = true; //are there any IDs on the disk
                    }
                }

                index = 1;
                diskSet.remove(HTODDynacache.DISKCACHE_MORE);
                Iterator idIterator = diskSet.iterator();
                while (idIterator.hasNext()) {
                    Object key = idIterator.next();
                    String skey = key.toString();
                    boolean matches = checkMatch(cpattern, skey);
                    if (matches) {
                        matchSet.add(skey);
                        //if (tc.isDebugEnabled()) {
                        //   Tr.debug(tc,"getCacheIDsOnDisk:  Disk Cache id = " +skey + " matches the pattern " + pattern + " for cacheInstance = " + cacheInstance);
                        //}
                    }
                }
            } while (more == true);
        }

        //Allocate output array #entries matched 
        String[] cids = matchSet.toArray(new String[matchSet.size()]);
        if (tc.isDebugEnabled())
            Tr.debug(tc, "getCacheIDsOnDisk: Exiting. Number of matches found = " + matchSet.size());
        return cids;
    }
628620
public static boolean find(final String pattern, final String string) {
        return createPattern(pattern, Pattern.CASE_INSENSITIVE).matcher(string).find();
    }
767865
public static boolean matches(String pattern, String value) {
        Pattern p = Pattern.compile(pattern);
        Matcher m = p.matcher(value);
        return m.matches();
    }
310907
protected List<Object> filterAttributeValuesByPattern(final Set<Object> attributeValues, final Pattern pattern) {
        return attributeValues.stream().filter(v -> RegexUtils.matches(pattern, v.toString(), completeMatch)).collect(Collectors.toList());
    }
368615
public static Completable clear(CacheConfigBean cacheConfigBean, String cacheKey) {
        return SingleRxXian.call(CacheService.CACHE_SERVICE, "cacheListClear", new JSONObject() {{
            put("cacheConfig", cacheConfigBean);
            put("key", cacheKey);
        }}).toCompletable();
    }