@Override
    public byte[] toByteArray() {
      ComparatorProtos.RegexStringComparator.Builder builder =
        ComparatorProtos.RegexStringComparator.newBuilder();
      builder.setPattern(pattern.pattern());
      builder.setPatternFlags(pattern.flags());
      builder.setCharset(charset.name());
      builder.setEngine(EngineType.JAVA.name());
      return builder.build().toByteArray();
    }
Implementation of the Engine interface using Java's Pattern.
<p>
This is the default engine.
hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RegexStringComparator.java