密码的正则表达式
我需要帮助创建密码正则表达式。 密码必须包含至少 4 个字符、字母(大写和小写)、数字和特殊字符 - 不含空格。
msn 类似正则表达式。
I need help creating a password regex.
A password must contain at least 4 characters, letters (uppercase and lowercase), numbers and special characters - no spaces.
msn like regular expression.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
该正则表达式有效 - 请参阅下面的测试数据和输出:
passwords.txt 中的测试数据(只有第一个应该通过):
您可以将所需的任何额外“特殊字符”添加到最后一个前瞻正则表达式的字符类中。
This regex works - see test data and output below:
Test data in passwords.txt (only the first should pass):
You can add whatever extra "special characters" you need into the last look ahead regex's character class.
使用这个:
如果字母可以是任何 Unicode 字母,您可以使用这个正则表达式:
要添加特殊字符,只需将它们放在
[]
中Use this:
If letter may be any Unicode letter, you can use this regex:
To add special characters, simply put them inside
[]
尝试一下
try that