Jun-26-2024, 01:06 PM
Regex can definitely be tricky! For the admin part, you might want to use something like (?=.*admin) to check if "admin" is part of the password and then invalidate it if found. To ensure the password meets certain criteria (like length, uppercase, digits, and special characters), you can use regex patterns like ^(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{12,}$. Combining these checks should help you validate the password effectively.