Select * from tabA t where 1=1 and id in (slect * from tabB b wehre #[adsds])and #[t.id||t.name||t.org||t.money]获取 #[] 之间的字符串adsdst.id||t.name||t.org||t.money
public static void main(String[] args) { String str = "Select * from tabA t where 1=1 and id in (slect * from tabB b wehre #[adsds])and #[t.id||t.name||t.org||t.money]"; Matcher m = Pattern.compile("#\\[(.*?)\\]").matcher(str); while(m.find()){ System.out.println(m.group(1)); } }
public static void main(String[] args) {
String str = "Select * from tabA t where 1=1 and id in (slect * from tabB b wehre #[adsds])and #[t.id||t.name||t.org||t.money]";
Matcher m = Pattern.compile("#\\[(.*?)\\]").matcher(str);
while(m.find()){
System.out.println(m.group(1));
}
}