"); 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; }

Department of Chemistry,

South University of Science and Technology of China

Address: No.1088, Xueyuan Blvd, Shenzhen, China 518055

E-Mail: ccli@sustc.edu.cn

Tel: 0755-88018333
 
 
 
脚注信息
Copyright © 2014, Li Group, Department of Chemistry, South University of Science and Technology of China
访问统计
You are visitor No.
You are visitor No.