代码提交
This commit is contained in:
@@ -8,6 +8,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import com.fasterxml.jackson.databind.type.TypeFactory;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
|
||||
@@ -26,6 +27,8 @@ import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static java.lang.Integer.parseInt;
|
||||
|
||||
@@ -306,4 +309,22 @@ public class PubUtils {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
//*****************************************xuyang添加,用于App********************************************************
|
||||
/**
|
||||
* 正则表达式字符串
|
||||
* 要匹配的字符串
|
||||
*
|
||||
* @return 如果str 符合 regex的正则表达式格式,返回true, 否则返回 false;
|
||||
*/
|
||||
public static boolean match(String regex, String str) {
|
||||
Pattern pattern = Pattern.compile(regex);
|
||||
Matcher matcher = pattern.matcher(str);
|
||||
return matcher.matches();
|
||||
}
|
||||
|
||||
public static boolean patternPasswordPhone(String password) {
|
||||
return match(PatternRegex.PASSWORD_PHONE_REGEX, password);
|
||||
}
|
||||
//***************************************************添加结束********************************************************
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user