"); return; } } public String toSelectSql(String q){ if(StringUtils.isBlank(q)) return ""; char c='\\'; int cIndex=q.indexOf(c); if(cIndex!=-1&&cIndex==0){ q=q.substring(1); } if(cIndex!=-1&&cIndex==q.length()-1){ q=q.substring(0,q.length()-1); } try { String regular = "[\\+\\-\\&\\|\\!\\(\\)\\{\\}\\[\\]\\^\\~\\*\\?\\:\\\\]"; Pattern p = Pattern.compile(regular); Matcher m = p.matcher(q); String src = null; while (m.find()) { src = m.group(); q = q.replaceAll("\\" + src, ("\\\\" + src)); } q = q.replaceAll("AND", "and").replaceAll("OR", "or").replace("NOT", "not"); } catch (Exception e) { q=q; } return q; }
 
图片详情
LCC-ESOC-2017-07
脚注信息
Copyright © 2014, Li Group, Department of Chemistry, South University of Science and Technology of China
访问统计
You are visitor No.
 You are visitor No.