search

Home  >  Q&A  >  body text

ruby 正则表达式验证密码

1 必须包含数字,大写字母,小写字母
2 不含有特殊字符
3 不少于6个字符
下面我写的不能过滤特殊字符
/^(?![0-9a-z]+$)(?![a-zA-Z]+$)(?![0-9A-Z]+$)w{6,}/
请帮忙改一下

淡淡烟草味淡淡烟草味2775 days ago697

reply all(1)I'll reply

  • 为情所困

    为情所困2017-04-25 09:04:16

    1 /^(?![0-9a-z]+$)(?![a-zA-Z]+$)(?![0-9A-Z]+$)[0-9a-zA-Z]{6,}$/
    2 /(?=.[A-Z])(?=.[a-z])(?=.*[0-9])^[a-zA-Z0-9]{6,}$/

    reply
    0
  • Cancelreply