private static void validateExpression(GroupingExpression exp) {
        // Fail in obviously invalid expressions
        if (exp instanceof BucketValue)
            throw new IllegalArgumentException("Regex predicate cannot be used with a bucket value");
        else if (exp instanceof AggregatorNode)
            throw new IllegalArgumentException("Regex predicate cannot be used with an aggregator");
        else if (exp instanceof PredefinedFunction)
            throw new IllegalArgumentException("Regex predicate cannot be used with a predefined function");
        else if (exp instanceof FixedWidthFunction)
            throw new IllegalArgumentException("Regex predicate cannot be used with a fixed width function");
    }
Represents a filter expression that matches a value from the evaluated expression against a regex.

@author bjorncs
container-search/src/main/java/com/yahoo/search/grouping/request/RegexPredicate.java