int result = 0;
int result = -1;
    public int match(String formattedString) {        int result = 0;        Matcher matcher = getRegexPattern().matcher(formattedString);        if ((getMatchingMode() == MODE_EQUALS) && matcher.matches()) {            result = matcher.end();        } else if ((getMatchingMode() == MODE_STARTS_WITH)                && matcher.lookingAt()) {            result = matcher.end();        }        return result;    }