private static void validateRegexProperty(
            Object value,
            Field field,
            List<String> errorMessages) {
        if (!(value instanceof String str)) {
            if (!(value instanceof Collection<?> collection)) {
                throw new IllegalArgumentException(
                        "The value of the field ("
                                + ClassUtil.getReference(field)
                                + ") must be a string or string list for regex validation");
            }
            for (Object val : collection) {
                validateRegexProperty(val, field, errorMessages);
            }
            return;
        }
        try {
            Pattern.compile(str);
        } catch (PatternSyntaxException exception) {
            String message = "The property \""
                    + field.getName()
                    + "\" has an invalid regex \""
                    + str
                    + "\"";
            errorMessages.add(message);
        }
    }
@implNote We don't use "hibernate-validator" because it has a terrible performance
turms-server-common/src/main/java/im/turms/server/common/infra/property/TurmsPropertiesValidator.java