以下[A-Z]可以根据需要修改。
输出
//匹配不包含重复字母
String regex = "^[A-Z]*([A-Z])[A-Z]*\\1[A-Z]*$";
System.out.println(!"ABCDEF".matches(regex));
System.out.println(!"ABCDEA".matches(regex));
System.out.println(!"A".matches(regex));
//匹配不包含连续重复字母
regex = "^[A-Z]*([A-Z])\\1[A-Z]*$";
System.out.println(!"ABCDEF".matches(regex));
System.out.println(!"ABCDEA".matches(regex));
System.out.println(!"ABBCDDEF".matches(regex));
System.out.println(!"A".matches(regex));
输出
true
false
true
true
true
false
true
本文深入探讨了AI音视频处理领域中的视频分割与语义识别技术,介绍了其在自动驾驶、AR、SLAM等场景的应用,并讨论了物体检测识别、语音识别变声等关键环节。
1622

被折叠的 条评论
为什么被折叠?



