啥?

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
public static void main(String[] args) {

//        String text3 = "啊啊啊标题@多项选择题描述@呵呵呵呵";
//        String reg3 = "(?<=标题@)[\\s\\S]*(?=描述@)";
//        Pattern p3 = Pattern.compile(reg3);
//        Matcher m3 = p3.matcher(text3);
//        if(m3.find()){
//            System.out.println(m3.group());
//        }
        String text = "Allowed with a fee of EUR 65.Not allowed for no-shows.";
        String newMessage = text.replaceAll(" ", "");
        String reg = "(?<=EUR)[\\s\\S]*(?=.Not)";
        Pattern p = Pattern.compile(reg);
        Matcher m = p.matcher(newMessage);
        String group="";
        if(m.find()){
            System.out.println(m.group());
            group = m.group();
        }
        System.out.println(group);
        while (StringUtils.isNoneBlank(group)){
            System.out.println(group);
        }


    }

 

posted on 2023-04-03 09:24  啥?  阅读(33)  评论(0编辑  收藏  举报