code: public static int preg_match(String regex, String subject) {
          Pattern p = Pattern.compile(regex);
          return preg_match(p, subject);
      }
docs: Matches a string with a regex.
  
  @param regex
  @param subject
  @return