模型形状导入,去掉形状名称的特殊字符导入校验

This commit is contained in:
446052889@qq.com 2022-09-14 13:49:07 +08:00
parent b831b5c3a1
commit df51a1e4c9
2 changed files with 9 additions and 8 deletions

View File

@ -27,15 +27,16 @@ public class ValidShapeName implements ValidShapeCell {
} else { } else {
if (value.length() > 128) { if (value.length() > 128) {
msg = "长度不允许超过128"; msg = "长度不允许超过128";
} else {
String regEx = "[ _`~!@#$%^&*()+=|{}'\":;',\\[\\].<>/?~@#¥%……&*()——+|{}【】‘;:”“’。,、?]|\n|\r|\t";
Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(value);
if (m.find()) {
msg = "名称不允许包含" + "|'\"。、,+*/%^=\\!&:;~`#<>$" + "等字符";
} else { } else {
isOk = true; isOk = true;
} // String regEx = "[ _`~!@#$%^&*()+=|{}'\":;',\\[\\].<>/?~@#¥%……&*()——+|{}【】‘;:”“’。,、?]|\n|\r|\t";
// Pattern p = Pattern.compile(regEx);
// Matcher m = p.matcher(value);
// if (m.find()) {
// msg = "名称不允许包含" + "|'\"。、,+*/%^=\\!&:;~`#<>$" + "等字符";
// } else {
// isOk = true;
// }
} }
} }
result.put("isOk", isOk); result.put("isOk", isOk);