2019.9.11课程设计报告

一、当天完成的任务

   写好了报告的正文和文献引用部分,队友负责整合和其他部分的撰写。

   看了点正则表达式,算是提前为12月份的CCF热个身。贴个链接和代码:

   https://www.bilibili.com/video/av31470518?from=search&seid=15051048559353276683

   

public static void main(String[] args) {
    // 要验证的字符串
    String str = "[email protected]";
    // 邮箱验证规则
    String regEx = "[a-zA-Z_]{1,}[0-9]{0,}@(([a-zA-z0-9]-*){1,}\\.){1,3}[a-zA-z\\-]{1,}";
    // 编译正则表达式
    Pattern pattern = Pattern.compile(regEx);
    // 忽略大小写的写法
    // Pattern pat = Pattern.compile(regEx, Pattern.CASE_INSENSITIVE);
    Matcher matcher = pattern.matcher(str);
    // 字符串是否与正则表达式相匹配
    boolean rs = matcher.matches();
    System.out.println(rs);
}
public static void main(String[] args) {
    // 要验证的字符串
    String str = "baike.xsoftlab.net";
    // 正则表达式规则
    String regEx = "baike.*";
    // 编译正则表达式
    Pattern pattern = Pattern.compile(regEx);
    // 忽略大小写的写法
    // Pattern pat = Pattern.compile(regEx, Pattern.CASE_INSENSITIVE);
    Matcher matcher = pattern.matcher(str);
    // 查找字符串中是否有匹配正则表达式的字符/字符串
    boolean rs = matcher.find();
    System.out.println(rs);
}

   

二、第二天的计划

   再给代码写点注释,传gitlab

三、每日小结

   ①报告好难写啊,感觉做的挺多的,但写起来感觉做的还是不够

   ②正则表达式真滴好用嘎嘎嘎

猜你喜欢

转载自www.cnblogs.com/RecKono/p/11508493.html