预查中不能匹配到\n,如果想匹配\n可以使用如下方法
String regex = "<el-dialog(?!.*close-on-click-modal)(.*?\\n(?!.*close-on-click-modal))*?.*?>";
String str = "<el-dialog close-on-click-modal\n close-on-click-modal=\"false\">";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(str);
if (matcher.find()) {
System.out.println("找到了");
} else {
System.out.println("未找到");
}