private static boolean checkStrValueNorms(WebFieldDef fieldDef, String paramVal,
            StringBuilder sBuffer, ProcessResult result) {
        paramVal = paramVal.trim();
        if (TStringUtils.isBlank(paramVal)) {
            result.setSuccResult(null);
            return true;
        }
        // check value's max length
        if (fieldDef.valMaxLen != TBaseConstants.META_VALUE_UNDEFINED) {
            if (paramVal.length() > fieldDef.valMaxLen) {
                result.setFailResult(sBuffer.append("over max length for ")
                        .append(fieldDef.name).append(", only allow ")
                        .append(fieldDef.valMaxLen).append(" length").toString());
                sBuffer.delete(0, sBuffer.length());
                return false;
            }
        }
        // check value's pattern
        if (fieldDef.regexCheck) {
            if (!paramVal.matches(fieldDef.regexDef.getPattern())) {
                if ((fieldDef != WebFieldDef.TOPICNAME
                        && fieldDef != WebFieldDef.COMPSTOPICNAME)
                        || !paramVal.equals(TServerConstants.OFFSET_HISTORY_NAME)) {
                    result.setFailResult(sBuffer.append("illegal value for ")
                            .append(fieldDef.name).append(", value ")
                            .append(fieldDef.regexDef.getErrMsgTemp()).toString());
                    sBuffer.delete(0, sBuffer.length());
                    return false;
                }
            }
        }
        result.setSuccResult(paramVal);
        return true;
    }
Parse the parameter string value by regex define

@param fieldDef     the parameter field definition
@param paramVal     the parameter value
@param sBuffer      string buffer
@param result       process result
@return check result for string value of parameter
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/common/utils/WebParameterUtils.java