随笔分类 -  正则

摘要:grep "a*" data.txt ##筛选data.txt文档中包括0,1,或多个与a相关的行 grep "aa*" data.txt ##匹配包括一个/多个a相关的行 grep "aaa*" data.txt ##匹配包括二个/多个a相关的行 2.“.”匹配除换行符外的任意字符 grep "s 阅读全文
posted @ 2017-11-08 22:13 凯西_Casey 阅读(270) 评论(0) 推荐(0)
摘要://简单认识正则表达式 p("abc".matches("...")); p("a1234a".replaceAll("\\d","^")); Pattern p = Pattern.compile("[a-z]{3}"); Matcher m = p.matcher("hll"); p(m.mat 阅读全文
posted @ 2017-11-02 22:20 凯西_Casey 阅读(210) 评论(0) 推荐(0)