public void writeRegex ( Pattern pattern ) throws IOException { _writeArrayFieldNameIfNeeded ( ) ; _verifyValueWrite ( "write regex" ) ; _buffer . putByte ( _typeMarker , BsonConstants . TYPE_REGEX ) ; _writeCString ( pattern . pattern ( ) ) ; _writeCString ( flagsToRegexOptions ( pattern . flags ( ) ) ) ; flushBuffer ( ) ; }
Write a BSON regex