code: protected static boolean validateRegExp(String pattern, String value)
              throws PatternSyntaxException {
          Pattern re = patternCache.get(pattern);
          if (re == null) {
              re = compile(pattern, MULTILINE | DOTALL);
              patternCache.put(pattern, re);
          }
  
          return (re.matcher(value).matches());
      }
docs: Validate the given value against a regular expression pattern
  
  @param pattern Regular expression pattern
  @param value Value to test
  @return boolean {@code true} if {@code value} matches {@code pattern}
  @throws PatternSyntaxException
  if the given pattern is invalid