日期:2014-05-17 浏览次数:20743 次
public static void main(String[] args) { String s = "(A1 + A2 + (X*90 + Y + 100)*N1)*100+A1"; Matcher m = Pattern.compile("[a-zA-Z]+\\d*").matcher(s); Set<String> set = new HashSet<String>(); while(m.find()){ set.add(m.group()); } for(String str : set){ System.out.println(str); } }