code: public static boolean regexMatch(String input, String regex) {
          return Pattern.compile(regex).matcher(input).matches();
      }
docs: If input matched regex
  
  @param input Input String
  @param regex Regex
  @return is matched