class EvaluationPhaseFilterFunctions {

    public static String getMatchToLeftOfPeriod(String input, int pos) {
        // always peel off the fieldName before the first '.'
        input = input.substring(input.indexOf('.') + 1);
        int[] indices = indicesOf(input, '.');
        if (indices.length < pos + 1)
            throw new RuntimeException("Input" + input + " does not have a '.' at position " + pos + " from the left.");
        return input.substring(0, indices[indices.length - pos - 1]);
    }

}