Valid password

Report a typo

Let's write a regexp that checks whether a given string is a valid password. A password can contain lower- and uppercase Latin letters, digits, the underscore character _, and the hyphen -. It should contain at least 5 characters.

Do not forget that you should check whether the entire string meets the requirements, not only the beginning of the string.

Tip: To do that, remember the metacharacters that check for the end of the string.

Write a program in Python 3
import re


# put your regex in the variable template
template = ""
___

Create a free account to access the full topic