@Test
public void testDynamicMatcher() {

    String message = "hello\nend";
    boolean matches = RegExpExt.dynamicMatcher(() -> ".*hello.*", Pattern.DOTALL, e -> {
        throw new IllegalStateException(e);
    }).apply(message).matches();
    assertThat(matches).isTrue();
}