Hands-on task
Password check in a single expression
/root/candidates.txt contains a list of candidate passwords. Using a single regular expression, select those that satisfy the policy all at once: contain an uppercase letter, contain a digit, contain at least one character that is not a letter or digit, and are at least 10 characters long. Write the result (in the original order) to /root/valid.txt.
- grep -P
- lookahead
- (?=...)
- zero-width assertion
- {n,} quantifier