I need to add a denylist to a Web application. It is working with a single string. Just not sure how to do it with multiple values
**Below is working fine **
def correct_password_format(password)
(
password.count('0-9').positive? &&
!password.match(/[^A-Za-z0-9]/).nil? &&
password.count('A-Z').positive? && password.count('a-z').positive? &&
password.length >= 8 && password != 'P@ssword1'
end
I need to add more than one item but having a hard time :(
def correct_password_format(password)
(
password.count('0-9').positive? &&
!password.match(/[^A-Za-z0-9]/).nil? &&
password.count('A-Z').positive? && password.count('a-z').positive? &&
password.length >= 8 && password != ['P@ssword1','shabixuege!@#','P@$$W0rd0123','P@ssw0rd5tgb','adminbigdata','Pa$$w0rdp!@#','adm1nistrator1','administrator!@#$'].include?
)
end