题解 | #简单错误记录#

密码验证合格程序

http://www.nowcoder.com/practice/184edec193864f0985ad2684fbc86841

正则表达式
1.Pattern.matches(".\d.",str)判断是否包含数字
2.Pattern.matches((".[a-z]."),str)) {
3. (Pattern.matches(".[A-Z].",str)) {
非字母数字
4. (Pattern.matches(".[^a-z^A-Z^0-9].",str)) {

5.判断重复子串
for (int i = 0; i < length - 3; i++) {
String substring = str.substring(i, i + 3);
if (str.substring(i + 1).contains(substring)) {
result = false;
}
}

全部评论

相关推荐

2025-12-22 16:31
已编辑
桂林电子科技大学 Python
很奥的前端仔:如果你接了offer 临时又说不去 hr确实要多做一些工作。 当然如果是接offer之前当我没说
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务