code: protected String findPattern(String strPattern, String text, int grp) {
  
      Pattern pattern = Pattern.compile(strPattern, Pattern.MULTILINE);
      Matcher matcher = pattern.matcher(text);
  
      if (matcher.find(0))
        return matcher.group(grp);
  
      return null;
    }
docs: Find the first occurence ofa pattern in a piece of text
  and return a specific group.
  
  @param strPattern the regular expression to match
  @param text the text to search
  @param grp the number of the matching group to return
  
  @return a String containing the matched group of the regular expression