[英]regex for password that does not allow \ symbol
Hello friends i am creating regex for password 您好朋友,我正在为密码创建正则表达式
here is my regex 这是我的正则表达式
/^(?=.*[A-Z])(?=.*[a-z])(?!.*[0-9~=?<>()`'"\/& ]).{8,20}.*$/
password should: 密码应:
=?<>()'"/\\&
. =?<>()'"/\\&
。 my regex is ok but it accept \\ symbol. 我的正则表达式可以,但可以接受\\符号。 But i dont allow this symbol so please suggest some solution.
但我不允许使用此符号,因此请提出一些解决方案。
I have been cautioned recently on this so placing my code in comment as answer. 我最近在此方面受到警告,因此请将我的代码放在注释中作为答案。
This regex should work: 这个正则表达式应该工作:
/^(?=.*[A-Z])(?=.*[a-z])(?!.*[\\0-9~=?<>()'"\/& ]).{8,20}$/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.