除了Konstantin的回答:Java 8
通过
Predicate对该
Pattern类添加了支持,该类在内部
asPredicate调用
Matcher.find():
Pattern pattern = Pattern.compile("...");List<String> matching = list.stream() .filter(pattern.asPredicate()) .collect(Collectors.toList());太棒了!

除了Konstantin的回答:Java 8
通过
Predicate对该
Pattern类添加了支持,该类在内部
asPredicate调用
Matcher.find():
Pattern pattern = Pattern.compile("...");List<String> matching = list.stream() .filter(pattern.asPredicate()) .collect(Collectors.toList());太棒了!