-1
0
Task:
Take a string as input and if it meets the requirements, accept the password.
Input: a string, e.g. someString, asjk23t89h, 123456789abcdef.
Output: two distinct values representing "secure" and "insecure", e.g. 0/1, true/false, secure/insecure.
Password requirements:
In order for a password to be determined as secure, it must:
- Be at least 8 characters in length.
- Contain at least one character each from the four groups
a-z,A-Z,0-9and!"£$%^&*()_+-={}[]:@~;'#<>?,./
Examples:
password-> insecurepassword123-> insecureL0h~[/1s7C-> secureh&fn3*#-> insecureC#de g07F-> secure
Winning:
This is code golf, the shortest answer wins.
3Related. – Laikoni – 2017-10-16T10:52:16.827
Can you clarify the "ASCII symbol" part? Do you mean any non-letter, non-digit ASCII character (including spaces, linefeeds, and other control characters)? Or do you mean printable/non-whitespace ASCII only? Also what range of characters can appear in the input in the first place? – Martin Ender – 2017-10-16T12:34:38.283
2Did you add a non-ASCII character (
£) to the list intentionally? – Martin Ender – 2017-10-16T12:39:27.820"Is my password secure?"
s->"no"(7 bytes answer in Java \o/) – Olivier Grégoire – 2017-10-16T14:36:35.847