|
|
|
|
|
by Cyberdog
1435 days ago
|
|
Haven't tried it since I'd rather not sign up for an account. But regarding this example: Minimum eight characters, at least one letter, one number and one special character
>> ^(?=.*[A-Za-z])(?=.*d)(?=.*[@$!%*#?&])[A-Za-zd@$!%*#?&]{8,}$
I assume the "d" characters here are supposed to be "\d" but the backslashes wandered off somewhere. Not sure if that's just in the example or the actual output from the AI. Some of those special characters like "*" and "$" need a backslash too.Also, this pattern will not allow any character which is not a letter, number, or in that very finite list of special characters - so no spaces, no carets, no quote marks or apostrophes, etc. Not allowing certain printable characters in a password is a bad practice (I won't complain too much if you forbid the non-printable ones). |
|
Regarding your other point, characters like `*` won't need escaping within character class. Not sure why only those particular set of characters are deemed "special characters" - why not `-`, `=`, parentheses, curly braces, etc?
Also, the site should specify which regex flavor is being generated, I'd guess JS.
All said, it is good to see tools to help with regex, as long as the solutions will be tested to make sure it fits their particular problem.