12

java正则例子

2017-07-03 13:34:00    1147533288    826    原创

1.sql变量提取

<!--

public static void main(String[] args){
        String a = "tablepk=#{TABLEPK} and unitcode=#{UNITCODE}";
        List<String> ls = getReg(a);
        System.out.println(ls);
    }
    public static List<String> getReg(String managers){
        List<String> ls=new ArrayList<String>();
        Pattern pattern = Pattern.compile("(?<=#\\{)(.+?)(?=\\})");
        Matcher matcher = pattern.matcher(managers);
        while(matcher.find())
            ls.add(matcher.group());
        return ls;
    }

-->

苏ICP备18038013号-1
蝉知 蝉知5.2