+ 1
[Codecoach]What would be the regex for this ?
my string should satisfy : 1. two special char(#$@!&*) 2. minimum two digits 3. minimum length :7 I tried with This: "^((?=.*[#$@!*&%]{2,})(?=.*[a-zA-Z]{0,})(?=.*[0-9]{2,})).{7,}
quot; Edit: 1. This is actually for Codecoach problem password validation. last test case is still not passing. Why ? 2. "^(?=.*\W{2,})(?=.*\d{2,}).{7,}quot; This is shorter version of my regex. Even this fails for the last test case. Why ? 3. "(?=(.*[0-9]){2,})(?=(.*[!@#$%&*]){2})(?=.{7,})" This passes all the test cases ! Why?5 odpowiedzi