console.log(regex.test("AaBb123!@#"));
// output: true
public static void main(String[] args) {
Pattern compile = Pattern.compile("^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[^a-zA-Z\\d\"'\\\\|])(?!.*[\"'\\\\|])");
Matcher matcher = compile.matcher("AaBb123!@#");
System.out.println(matcher.matches());
// output: false
}
丢给 AI 也看不出什么问题,AI 的结论是两段代码输出都应该一样为 true