ValidationUtilities { 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()); }  static boolean isValid(Annotation annotation); static boolean isValid(AnnotationDefinition annoDef, String value);  }
@Test(expected = PatternSyntaxException.class) public void issue15() { ValidationUtilities.validateRegExp("?", ""); }
@Test public void matchMultiline() { String regex = "^.*$"; assertTrue(ValidationUtilities.validateRegExp(regex, "abc\n def")); }
@Test public void matchCharacter() { String regex = "^.$"; assertTrue(ValidationUtilities.validateRegExp(regex, "\n")); assertFalse(ValidationUtilities.validateRegExp(regex, "\n\n")); }