code: public static boolean matches(String pattern, String value) {
          Pattern p = Pattern.compile(pattern);
          Matcher m = p.matcher(value);
          return m.matches();
      }
docs: Validate if the given value matches the pattern
  @param pattern The pattern
  @param value The value
  @return true if value matches pattern