正则表达式 最全的常用正则表达式大全——包括校验数字、字符、一些特殊的需求等等

java正则表达式和linux表达式是有一些不一样的

def test11(): Unit ={ val date = "2017-08-09" val warn = "WARN" val strs = Array("2017-08-09 10:24:11,040 RN org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode: Checkpoint done. New Image Size: 117430", "2017-08-09 11:24:11,570 WARN org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode: Checkpoint done. New Image Size: 117230", "2017-08-09 11:24:11,570 WA org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode: Checkpoint done. New Image Size: 117230", "2017-08-09 11:24:11,570 WARN org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode: Checkpoint done. New Image Size: 117230") strs.filter(_.matches(".*2017-08-09.*WARN.*")).foreach(println(_)) }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zgyzzg.html