加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

2019.9.11课程设计报告

发布时间:2020-12-14 05:35:11 所属栏目:百科 来源:网络整理
导读:一、当天完成的任务 ? ? 写好了报告的正文和文献引用部分,队友负责整合和其他部分的撰写。 ? ?看了点正则表达式,算是提前为12月份的CCF热个身。贴个链接和代码: ? ?https://www.bilibili.com/video/av31470518?from=searchseid=15051048559353276683 ? ?

一、当天完成的任务

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

? ?看了点正则表达式,算是提前为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

三、每日小结

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

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读