package com.njcn.product.carrycapacity.util;

import com.njcn.common.pojo.constant.PatternRegex;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.web.constant.ValidMessage;

import java.util.regex.Pattern;

/**
 * Description:
 * Date: 2024/12/10  14:51【需求编号】
 *
 * @author clam
 * @version V1.0.0
 */
public  class CheckStringUtil {
    public static void checkName(String name) {
        String SPECIALCHARACTER ="[<>%'%;()&+/\\\\-\\\\\\\\_|@*?#$!,.]|html";
        Pattern pattern = Pattern.compile(SPECIALCHARACTER);
        if(pattern.matcher(name).find()){
            throw new BusinessException(ValidMessage.NAME_SPECIAL_REGEX);
        }
    }

//    public static void main(String[] args) {
//        checkName("100迈岭站2djvjva13ad");
//    }

}
