select * from tableName where id = "1 ";
像这样一句select语句,如何才能截取到 "tableName "呢?
不一定有where,也许会是order by
------解决方案--------------------
光字符串处理?
String str = "select * FROM tableName where id = \ "1\ " ";
Pattern wd = Pattern.compile( "(? <=from) +(\\w+).* ",
Pattern.CASE_INSENSITIVE);
Matcher m = wd.matcher(str);
if (m.find()) {
System.out.println(m.group(1));
}