zoukankan      html  css  js  c++  java
  • 2019.9.11课程设计报告

    一、当天完成的任务

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

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

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

       

    public static void main(String[] args) {
        // 要验证的字符串
        String str = "service@xsoftlab.net";
        // 邮箱验证规则
        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

    三、每日小结

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

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

  • 相关阅读:
    你自己不优秀,就算认识再多优秀人又有何用
    史玉柱和他老同学的一段故事
    哪有雪中送碳,都是锦上添花
    围城之困
    心已死,梦前行
    一位销售高手逼单经历!
    Python--函数return多个值
    Python--内置函数
    Python--小程序
    Python--递归
  • 原文地址:https://www.cnblogs.com/RecKono/p/11508493.html
Copyright © 2011-2022 走看看