/** * Verifies that the actual {@code CharSequence} does not match the given regular expression * pattern. * * <p>Example : * * <pre> * // assertion will pass * assertThat("Frodo").doesNotMatch(Pattern.compile(".*d")); * * // assertion will fail * assertThat("Frodo").doesNotMatch(Pattern.compile("..o.o")); * </pre> * * @param pattern the regular expression to which the actual {@code CharSequence} is to be * matched. * @return {@code this} assertion object. * @throws NullPointerException if the given pattern is {@code null}. * @throws AssertionError if the actual {@code CharSequence} does not match the given regular * expression. */ public S doesNotMatch(Pattern pattern) { strings.assertDoesNotMatch(info, actual, pattern); return myself; }
/** * Verifies that the actual {@code CharSequence} does not match the given regular expression. * * <p>Example : * * <pre> * // assertion will pass * assertThat("Frodo").doesNotMatch(".*d"); * * // assertion will fail * assertThat("Frodo").doesNotMatch("..o.o"); * </pre> * * @param regex the regular expression to which the actual {@code CharSequence} is to be matched. * @return {@code this} assertion object. * @throws NullPointerException if the given pattern is {@code null}. * @throws PatternSyntaxException if the regular expression's syntax is invalid. * @throws AssertionError if the actual {@code CharSequence} is {@code null}. * @throws AssertionError if the actual {@code CharSequence} matches the given regular expression. */ public S doesNotMatch(CharSequence regex) { strings.assertDoesNotMatch(info, actual, regex); return myself; }