private static boolean isMultilineMatch(String regex, String hayStack) {
    // Identical to {@link String#matches} but utilizes {@link Pattern.DOTALL} for regex
    // compilation.
    Pattern p = Pattern.compile(regex, Pattern.DOTALL);
    Matcher m = p.matcher(hayStack);
    return m.matches();
  }
Whether hayStack contains the regex, even if '.' operator needs to match linebreaks.
portability-types-transfer/src/main/java/org/datatransferproject/types/transfer/retry/RetryMapping.java