int result = 0;
int result = -1;
    public int parse(String formattedString, Request request) {        int result = 0;        Matcher matcher = getRegexPattern().matcher(formattedString);        boolean matched = ((getMatchingMode() == MODE_EQUALS) && matcher                .matches())                || ((getMatchingMode() == MODE_STARTS_WITH) && matcher                        .lookingAt());        if (matched) {            // Update the number of matched characters            result = matcher.end();            // Update the attributes with the variables value            String attributeName = null;            String attributeValue = null;            for (int i = 0; i < getRegexVariables().size(); i++) {                attributeName = getRegexVariables().get(i);                attributeValue = matcher.group(i + 1);                request.getAttributes().put(attributeName, attributeValue);            }        }        return result;    }