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.