c# - 任何人都可以解决 C# regx 表达式
问题描述
- 至少一个小写字母,
- 至少有一个大写字母,
- 至少特殊字符,
- 至少一个数字
- 至少 8 个字符长度
问题在 regx 模式中的“/d”处显示错误
private void txtpassword_Leave(object sender, EventArgs e) {
Regex pattern = new Regex("/^(?=.*[a-z])(?=.*[A-Z])(?=.*/d)(?=.*[#$@!%&*?])[A-Za-z/d#$@!%&*?]{10,12}$/");
if (pattern.IsMatch(txtpassword.Text)) {
MessageBox.Show("valid");
} else {
MessageBox.Show("Invalid");
txtpassword.Focus();
}
}
解决方案
推荐阅读
- html - 如何将 url 更改为 django 上的路径
- string - 存储和使用变长字符串 (ADA)
- regex - 从文件中评估某些正则表达式以替换字符串中的字符
- f# - F#、Deedle 和 OptionalValue:对象必须实现 IConvertible 错误
- html - 使用 FLWOR 将图像放入表格中
- sql-server - SQL server JDBC不抛出Lock timeout异常但提交成功
- angular - NgRx 选择器返回未定义
- strace - Strace,如何查看 fork 系统调用?
- javascript - http get请求后将文件上传到谷歌驱动器
- reactjs - jest.doMock 没有调用模拟函数