需求说明:空格、符号、全数字 ,符号中英文符号的文本,要拦截,不让通过。
这里是用String pattern = "\\p{P}+"; 来过滤筛选出中英文符号。
代码例子:
private void checkSignatureText(String signatureText) throws FuiouException {
ValidateUtil.checkEmpty(signatureText, "短信签名");
// ValidateUtil.checkLength(signatureText,"短信签名",8,2);
//校验,不支持:空格、符号、全数字 ,符号中英文符号
// char[] signatureChs=signatureText.toCharArray();
// for(char c:signatureChs){
// if(c==32){
// throw new FuiouException(RspmsgConst.FAILE_CODE, "短信签名不支持空格!");
// }
// 48-57数字,65-90大写字母,97-122大写字母 ,0-127以内的英文字母
// if(c<127 && !(c>47 &