Пример #1
0
 public List<String> getTwitterLinksFromComment(Comment comment) {
   List<String> twitterLinks = new ArrayList<>();
   Matcher matcher = pattern.matcher(comment.getBody());
   while (matcher.find()) {
     twitterLinks.add(matcher.group(TWITTER_LINK_REGEX_GROUP));
   }
   return twitterLinks;
 }
Пример #2
0
 public boolean commentMatchesRegex(Comment comment) {
   return pattern.matcher(comment.getBody()).find();
 }