微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

三、每日小结

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

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐