创建用于密码验证的正则表达式 [英] Create regex for password validation
本文介绍了创建用于密码验证的正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我需要密码验证正则表达式.
至少8个字符.
特殊字符-仅@
字母数字
大写字母-至少一个
小写字母-至少一个
这是我当前的正则表达式:
^.*(?=.{8,})(?=.* \ d)(?=.* [az])(?=.* [AZ])(?=.* [!* @ #$%^& + =]).* $
但它接受不同种类的特殊字符.请帮忙.
谢谢!
Hi All,
I need a password validation regex.
At least 8 characters.
Special character - @ only
Alphanumeric
Uppercase - at least one
Lowercase - at least one
Here is my current regex:
^.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!*@#$%^&+=]).*$
but it accept different kinds of special character. Please help.
Thank you!
推荐答案
%^& + =]).*
%^&+=]).*
但它接受不同种类的特殊字符.请帮忙.
谢谢!
but it accept different kinds of special character. Please help.
Thank you!
尝试一下
(?= ^.{8,}
Try this
(?=^.{8,}
这篇关于创建用于密码验证的正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文