62,621
社区成员
发帖
与我相关
我的任务
分享
String sql="select a,b,c from abc where id=1 order by id desc";
String regex="\\bfrom\\s*\\S*";
Pattern p=Pattern.compile(regex);
Matcher m=p.matcher(sql);
if(m.find()){
String table=m.group().replace("from","");
System.out.println(""+table.trim());
}else{
System.out.println("not found");
}