Code
import java.util.*;
import java.util.regex.*;
public class JavaRegularExpressionUtil {
public static ArrayList<String> findMatches(String input, String expression) {
ArrayList<String> matches = new ArrayList<String>();
Pattern pattern = Pattern.compile(expression);
Matcher matcher = pattern.matcher(input);
while (matcher.find()) {
matches.add(matcher.group());
}
return matches;
}
}
posted @
2009-04-09 07:22
N/A2011
阅读(
235)
评论()
编辑
收藏
举报