新增字母数字正则校验

This commit is contained in:
wanggeng 2021-10-21 18:08:22 +08:00
parent 1fd2dcb70c
commit fab1303746
2 changed files with 15 additions and 0 deletions

View File

@ -83,6 +83,10 @@ public class RegexUtil {
* 字母
*/
private static final Pattern PATTERN_LETTER = Pattern.compile("[a-zA-Z]+");
/**
* 字母和数字
*/
private static final Pattern PATTERN_LETTER_OR_NUMBER = Pattern.compile("[a-zA-Z0-9]+");
/**
* 中文
*/
@ -278,6 +282,16 @@ public class RegexUtil {
return PATTERN_LETTER.matcher(input).matches();
}
/**
* 判断是字母或数字
*
* @param input
* @return
*/
public static boolean isLetterOrNumber(String input) {
return PATTERN_LETTER_OR_NUMBER.matcher(input).matches();
}
/**
* 判断是中文
*

View File

@ -210,6 +210,7 @@
title: '选择用户',
width: '500px',
height: '500px',
closeBtn: 0,
onClose: function() {
var selectedUsers = top.dialog.dialogData.selectedDepartmentUsers;
if(selectedUsers != null && selectedUsers.length > 0) {