密码的正则表达式必须包含至少八个字符、至少一个数字以及大小写字母和特殊字符

Regex for password must contain at least eight characters, at least one number and both lower and uppercase letters and special characters(密码的正则表达式必须包含至少八个字符、至少一个数字以及大小写字母和特殊字符)
本文介绍了密码的正则表达式必须包含至少八个字符、至少一个数字以及大小写字母和特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个正则表达式来检查:

I want a regular expression to check that:

密码至少包含八个字符,包括至少一个数字,同时包含大小写字母和特殊字符,例如#?!.

A password contains at least eight characters, including at least one number and includes both lower and uppercase letters and special characters, for example #, ?, !.

它不能是您的旧密码或包含您的用户名、"password""websitename"

It cannot be your old password or contain your username, "password", or "websitename"

这是我的验证表达式,它适用于八个字符,包括一个大写字母、一个小写字母和一个数字或特殊字符.

And here is my validation expression which is for eight characters including one uppercase letter, one lowercase letter, and one number or special character.

(?=^.{8,}$)((?=.*d)|(?=.*W+))(?![.
])(?=.*[A-Z])(?=.*[a-z]).*$"

密码必须是八个字符,包括一个大写字母、一个特殊字符和字母数字字符?

推荐答案

最少八个字符,至少一个字母和一个数字:

Minimum eight characters, at least one letter and one number:

"^(?=.*[A-Za-z])(?=.*d)[A-Za-zd]{8,}$"

最少八个字符,至少一个字母、一个数字和一个特殊字符:

Minimum eight characters, at least one letter, one number and one special character:

"^(?=.*[A-Za-z])(?=.*d)(?=.*[@$!%*#?&])[A-Za-zd@$!%*#?&]{8,}$"

最少八个字符,至少一个大写字母、一个小写字母和一个数字:

Minimum eight characters, at least one uppercase letter, one lowercase letter and one number:

"^(?=.*[a-z])(?=.*[A-Z])(?=.*d)[a-zA-Zd]{8,}$"

最少八个字符,至少一个大写字母,一个小写字母,一个数字和一个特殊字符:

Minimum eight characters, at least one uppercase letter, one lowercase letter, one number and one special character:

"^(?=.*[a-z])(?=.*[A-Z])(?=.*d)(?=.*[@$!%*?&])[A-Za-zd@$!%*?&]{8,}$"

最少 8 个字符,最多 10 个字符,至少 1 个大写字母、1 个小写字母、1 个数字和 1 个特殊字符:

Minimum eight and maximum 10 characters, at least one uppercase letter, one lowercase letter, one number and one special character:

"^(?=.*[a-z])(?=.*[A-Z])(?=.*d)(?=.*[@$!%*?&])[A-Za-zd@$!%*?&]{8,10}$"

这篇关于密码的正则表达式必须包含至少八个字符、至少一个数字以及大小写字母和特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)
Bind multiple parameters from route and body to a model in ASP.NET Core(在ASP.NET Core中将路由和主体中的多个参数绑定到一个模型)
Custom model binding in AspNet Core WebApi?(AspNet Core WebApi中的自定义模型绑定?)
Parse multiline log entries using a regex(使用正则表达式解析多行日志条目)