Code example for Matcher

Methods: find, group

0
     * @return The tag if it exists, or the original key 
     */ 
    public String getKeyTag(String key) {
        if (tagPattern != null) {
            Matcher m = tagPattern.matcher(key);
            if (m.find())
                return m.group(1);
        } 
        return key;
    } 
 
    public Collection<S> getAllShardInfo() {
        return Collections.unmodifiableCollection(nodes.values());
    } 
 
    public Collection<R> getAllShards() {
        return Collections.unmodifiableCollection(resources.values());
    } 
}