class RegexpDefinitionPatternMatcher implements DefinitionPatternMatcher {

    public Definition createDefinition(String definitionName) {
        Definition retValue = null;
        Matcher matcher = pattern.matcher(definitionName);
        if (matcher.matches()) {
            int groupCount = matcher.groupCount() + 1;
            Object[] vars = new Object[groupCount];
            for (int i = 0; i < groupCount; i++) {
                vars[i] = matcher.group(i);
            }
            retValue = PatternUtil.replacePlaceholders(definition,
                    definitionName, vars);
        }
        return retValue;
    }

    public  RegexpDefinitionPatternMatcher(String pattern, Definition definition);

}