java根据正则匹配字符串中间某部分内容数据 小咪咪 2023-07-23 08:57 3阅读 0赞 根据字符串内容前后匹配查询中间内容 @Test public void test(){ String sss ="19/11/28 15:04:36 INFO Client: Application report for application_1574829583306_0018 has started running"; Pattern p=Pattern.compile("19/11/28 15:04:36 INFO Client: Application report for (\\w+) has started running"); Matcher m=p.matcher(sss); while(m.find()){ System.out.println(m.group(1)); } } 结果:![watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1hpYW9kb25nZ2U1MjE_size_16_color_FFFFFF_t_70][] [watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1hpYW9kb25nZ2U1MjE_size_16_color_FFFFFF_t_70]: /images/20230528/b6caf5398008472c9e403d9e35eb657c.png
还没有评论,来说两句吧...