@Override BsonRegex readRegex(@Loose @ModifiesIndexes ByteBuf byteBuf) throws NettyBsonReaderException { String pattern = getStringReader().readCString(byteBuf, false); String options = getStringReader().readCString(byteBuf, true); EnumSet<BsonRegex.Options> optionsSet = ParsingTools.parseRegexOptions(options); return new DefaultBsonRegex(optionsSet, pattern); }
case REGULAR_EXPRESSION: { BsonRegularExpression casted = value.asRegularExpression(); return new DefaultBsonRegex(parseRegexOptions(casted.getOptions()), casted.getPattern());