2011-02-07 31 views

回答

12
Pattern p = Pattern.compile(regex); 
Matcher m = p.matcher(input); 
List<String> matches = new ArrayList<String>(); 
while(m.find()){ 
    matches.add(m.group()); 
} 
+0

謝謝!我試過了,之前沒有用。一定是我的正則表達式搞砸了。 – 2011-02-07 06:02:44