RegEx question for password strength validation

后端 未结 2 889
醉酒成梦
醉酒成梦 2021-01-05 22:49

I\'m looking for a single regular expression for our password requirements. Passwords:

  • Must be at least 8 characters
  • Cannot contain spaces
  • Co
2条回答
  •  没有蜡笔的小新
    2021-01-05 23:33

    It'll probably be easier to code the logic. Regex is used for matching patterns. Passwords tend to be somewhat random strings, so the problem doesn't lend itself easily to be solved by a regex. It's possible but will be cryptic to read and hard to maintain.

提交回复
热议问题