0

I tried to do this but it is not working...

^(?=.*\d+\d)(?=.*[a-zA-Z])[\dA-Za-z]{6,8}$

jonsca
  • 10,218
  • 26
  • 54
  • 62
  • 4
    i would just do this in code – pm100 May 27 '22 at 00:38
  • I agree with @pm100 - unless you _really_ need this in a `RegularExpressionAttribute`, having it in code would be much simpler and testable. – stuartd May 27 '22 at 00:41
  • 1
    Does this answer your question? [Regex for password must contain at least eight characters, at least one number and both lower and uppercase letters and special characters](https://stackoverflow.com/questions/19605150/regex-for-password-must-contain-at-least-eight-characters-at-least-one-number-a) – Ken White May 27 '22 at 01:04
  • 1
    Sounds like you could adjust your pattern to [something like this](https://regex101.com/r/GJcb43/1). – bobble bubble May 27 '22 at 08:01

0 Answers0