@Override
    protected void onSerialize(Serializer buf) {
        putUtf8(buf, pattern);
        // Future-proofing: allow optional expression in protocol in case it's added later to the grouping language
        serializeOptional(buf, expression);
    }
Protocol class for {@code RegexPredicate}.

@author bjorncs
searchlib/src/main/java/com/yahoo/searchlib/expression/RegexPredicateNode.java