|
@@ -1,5 +1,8 @@
|
|
package org.springblade.manager.utils;
|
|
package org.springblade.manager.utils;
|
|
|
|
|
|
|
|
+import java.util.regex.Matcher;
|
|
|
|
+import java.util.regex.Pattern;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 正则表达式工具类
|
|
* 正则表达式工具类
|
|
*/
|
|
*/
|
|
@@ -17,21 +20,28 @@ public class RegularExpressionUtil {
|
|
switch (filedType) {
|
|
switch (filedType) {
|
|
case "bigint":
|
|
case "bigint":
|
|
return obj.POSITIVE_NEGTIVE_INTEGER;
|
|
return obj.POSITIVE_NEGTIVE_INTEGER;
|
|
- //return obj.POSITIVE_NEGTIVE_INTEGER.replaceAll("\\\\\\\\", "\\\\");
|
|
|
|
|
|
+ //return obj.POSITIVE_NEGTIVE_INTEGER.replaceAll("\\\\\\\\", "\\\\");
|
|
case "decimal":
|
|
case "decimal":
|
|
return obj.POSITIVE_NEGTIVE_FLOAT;
|
|
return obj.POSITIVE_NEGTIVE_FLOAT;
|
|
- //return obj.POSITIVE_NEGTIVE_FLOAT.replaceAll("\\\\\\\\", "\\\\");
|
|
|
|
|
|
+ //return obj.POSITIVE_NEGTIVE_FLOAT.replaceAll("\\\\\\\\", "\\\\");
|
|
case "datetime":
|
|
case "datetime":
|
|
return obj.DATE_TIME;
|
|
return obj.DATE_TIME;
|
|
- //return obj.DATE_TIME.replaceAll("\\\\\\\\", "\\\\");
|
|
|
|
|
|
+ //return obj.DATE_TIME.replaceAll("\\\\\\\\", "\\\\");
|
|
}
|
|
}
|
|
return "";
|
|
return "";
|
|
}
|
|
}
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
|
- /*String str = "datetime";
|
|
|
|
- System.out.println(getRegularExpression(str));*/
|
|
|
|
- }
|
|
|
|
|
|
+ /*public static void main(String[] args) {
|
|
|
|
+ *//*String str = "datetime";
|
|
|
|
+ System.out.println(getRegularExpression(str));
|
|
|
|
+ *//*
|
|
|
|
+ String str = "2020-01-01";
|
|
|
|
+ String pattern = "^\\d{4}-\\d{1,2}-\\d{1,2}";
|
|
|
|
+
|
|
|
|
+ Pattern r = Pattern.compile(pattern);
|
|
|
|
+ Matcher m = r.matcher(str);
|
|
|
|
+ System.out.println(m.matches());
|
|
|
|
+ }*/
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|