You're building a sign up component and need to validate whether a user's desired password is secure enough.
Given a password (string) return true if the password meets the following criteria and false if it doesn't.
Password criteria:
- One lowercase letter
- One uppercase letter
- One special character (!@#$%^&*)
- One number
- At least 8 characters long
- Use regex to test whether the password is valid
- Use a ternary operator to return "Your password is valid" if it meets all requirements and "Your password is not valid, try again" if it doesn't.