String str="from\\s+(.*)\\s+where?"; String sql="select * from table,table2 where a=b"; Pattern p=Pattern.compile(str); Matcher matcher=p.matcher(sql); while (matcher.find()) { String string =matcher.group(1); System.out.println(string); }
半成品在哪儿?