From a29a8d00dd9bbcde53814119ad4a081f3b4c6740 Mon Sep 17 00:00:00 2001
From: kaiyu <404897439@qq.com>
Date: Mon, 06 Sep 2021 13:24:28 +0800
Subject: [PATCH] screen-manage 插入设备的时候,判断组织是否含有型号并且添加默认报警值
---
screen-common/src/main/java/com/moral/util/RegexUtils.java | 33 ++++++++++++++++++++++++++++-----
1 files changed, 28 insertions(+), 5 deletions(-)
diff --git a/screen-common/src/main/java/com/moral/util/RegexUtils.java b/screen-common/src/main/java/com/moral/util/RegexUtils.java
index 5023a3d..eca464c 100644
--- a/screen-common/src/main/java/com/moral/util/RegexUtils.java
+++ b/screen-common/src/main/java/com/moral/util/RegexUtils.java
@@ -12,22 +12,20 @@
* @return ���������������true���������������������false
*/
public static boolean checkAccount(String account) {
- String regex = "[a-zA-Z]\\w{3,19}";
+ String regex = "[a-zA-Z]\\w{2,19}";
return account.matches(regex);
}
- public static void main(String[] args) {
- }
/**
* ������������
*
- * @param password ������������������ ������ , ��������� , ������������������������3 ��� 20 ������
+ * @param password ������������������ ������ , ��������� , ������������������������6 ��� 20 ������
* @return ���������������true���������������������false
*/
public static boolean checkPassword(String password) {
- String regex = "[0-9a-zA-Z_]\\w{3,19}";
+ String regex = "[0-9a-zA-Z_]\\w{5,19}";
return password.matches(regex);
}
@@ -136,6 +134,18 @@
}
/**
+ * @Description: ������yyyy-MM-dd���������������������������
+ * @Param: [date]
+ * @return: boolean
+ * @Author: ���������
+ * @Date: 2021/3/23
+ */
+ public static boolean checkDate(String date){
+ String regex = "((\\d{2}(([02468][048])|([13579][26]))[\\-]((((0?[13578])|(1[02]))[\\-]((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-]((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-]((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([02468][1235679])|([13579][01345789]))[\\-]((((0?[13578])|(1[02]))[\\-]((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-]((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-]((0?[1-9])|(1[0-9])|(2[0-8]))))))";
+ return Pattern.matches(regex,date);
+ }
+
+ /**
* ������URL������
*
* @param url ���������http://blog.csdn.net:80/xyang81/article/details/7705960? ��� http://www.csdn.net:80
@@ -185,4 +195,17 @@
return Pattern.matches(regex, ipAddress);
}
+ /**
+ * @Description: ���������������������������������
+ * @Param: [str]
+ * @return: boolean
+ * @Author: ���������
+ * @Date: 2021/4/21
+ */
+ public static boolean checkContainChinese(String str){
+ Pattern p = Pattern.compile("[\u4e00-\u9fa5]");
+ Matcher matcher = p.matcher(str);
+ return matcher.find();
+ }
+
}
\ No newline at end of file
--
Gitblit v1.8.0