code: public static String regexFindFirst(String pattern, String str) {
      return regexFindFirst(Pattern.compile(pattern), str, 1);
    }
docs: Gets the first group of a regex
  @param pattern Pattern
  @param str String to find
  @return the matching group