随笔分类 -  正则

摘要:1 这里引用了 hutool 依赖 <dependency> <groupId>io.github.openfeign</groupId> <artifactId>feign-core</artifactId> </dependency> 正则 表达式 [1-9]\\d+?$|100$|0$ 测试类 阅读全文
posted @ 2021-10-18 10:56 未确定 阅读(1077) 评论(0) 推荐(0)
摘要:\ 标记向后引用 \s 空格 - 横杠 :punct: 任何标点符号 String localDate= LocalDate.now().toString().replaceAll("[[\\s-:punct:]]",""); System.out.println(localDate); 阅读全文
posted @ 2021-03-26 15:48 未确定 阅读(413) 评论(0) 推荐(0)
摘要:要求 1 只有英文或者数字 2 长度大于6位 3 不能全部是相同的数字或字母 解决: 自己写了一个测试类 public class emailTest { public static void main(String[] args) { for(int i =0;i<10;i++){ Scanner 阅读全文
posted @ 2020-12-07 18:44 未确定 阅读(1028) 评论(0) 推荐(0)
摘要:2020-10-26Email email;String regex = "[A-Za-z0-9]+([_\\.][A-Za-z0-9]+)*@([A-Za-z0-9\\-]+\\.)+[A-Za-z]{2,6}";Pattern pattern;Matcher matcher;pattern = 阅读全文
posted @ 2020-10-26 10:04 未确定 阅读(75) 评论(0) 推荐(0)