private int joniToPatternFlags(int flags) {
      int newFlags = 0;
      if ((flags & Option.IGNORECASE) != 0) {
        newFlags |= Pattern.CASE_INSENSITIVE;
      }
      // This does NOT mean Pattern.MULTILINE, this is equivalent to Pattern.DOTALL
      if ((flags & Option.MULTILINE) != 0) {
        newFlags |= Pattern.DOTALL;
      }
      // This means Pattern.MULTILINE. Nice
      if ((flags & Option.NEGATE_SINGLELINE) != 0) {
        newFlags |= Pattern.MULTILINE;
      }
      return newFlags;
    }
Implementation of the Engine interface using Jruby's joni regex engine.
<p>
This engine operates on byte arrays directly so is expected to be more GC friendly, and
reportedly is twice as fast as Java's Pattern engine.
<p>
NOTE: Only the {@link Pattern} flags CASE_INSENSITIVE, DOTALL, and MULTILINE are supported.
hbase-client/src/main/java/org/apache/hadoop/hbase/filter/RegexStringComparator.java