code: protected String flagsToRegexOptions(int flags) {
  		StringBuilder options = new StringBuilder();
  		if ((flags & Pattern.CASE_INSENSITIVE) != 0) {
  			options.append("i");
  		}
  		if ((flags & Pattern.MULTILINE) != 0) {
  			options.append("m");
  		}
  		if ((flags & Pattern.DOTALL) != 0) {
  			options.append("s");
  		}
  		if ((flags & Pattern.UNICODE_CASE) != 0) {
  			options.append("u");
  		}
  		return options.toString();
  	}
docs: Converts a a Java flags word into a BSON options pattern
  
  @param flags the Java flags
  @return the regex options string