super(serializer);
}
@Override
public void serialize(Object obj, StringBuilder buf) {
DBObject externalForm = new BasicDBObject();
externalForm.put("$regex", obj.toString());
if (((Pattern) obj).flags() != 0)
externalForm.put("$options",
Bytes.regexFlags(((Pattern) obj).flags()));
serializer.serialize(externalForm, buf);
}