public static Optional<Reference> simple(String feature) {
        int startParenthesis = feature.indexOf('(');
        if (startParenthesis < 1)
            return Optional.empty();
        int endParenthesis = feature.lastIndexOf(')');
        String featureName = feature.substring(0, startParenthesis);
        if (endParenthesis < startParenthesis)
            return Optional.empty();
        String argument = feature.substring(startParenthesis + 1, endParenthesis);
        if (argument.startsWith("'") || argument.startsWith("\""))
            argument = argument.substring(1);
        if (argument.endsWith("'") || argument.endsWith("\""))
            argument = argument.substring(0, argument.length() - 1);
        if ( ! isValidIdentifier(argument))
            return Optional.empty();
        Reference result = simple(featureName, argument);
        if (endParenthesis + 1 == feature.length())
            return Optional.of(result);
        // text after end parenthesis; must be ".outputname"
        int lastDot = feature.lastIndexOf('.');
        if (endParenthesis + 1 == lastDot && lastDot + 1 < feature.length()) {
            String outputName = feature.substring(lastDot + 1);
            if (isValidIdentifier(outputName)) {
                result = result.withOutput(outputName);
                return Optional.of(result);
            }
        }
        return Optional.empty();
    }
Returns the given simple feature as a reference, or empty if it is not a valid simple
feature string on the form name(argument) or name(argument).outputname
searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/Reference.java