Pattern validation always failing

Morning all,

I’m trying to set up a validator for a user creating a password using the pattern validator.

I have this regex that forces a minimum of 8 characters, at least 1 uppercase letter, 1 lowercase letter, 1 digit and 1 special character. It always fails to validate even when all the requirements are met.

/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/

I even tried removing the delimiters on the side. Any idea what I’m doing wrong?

Screenshot 2024-01-09 at 9.59.56 AM

Thanks in advance,
Twitch

Try removing the / and / surrounding the expression so it becomes:

^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$

Thank you @Teodor. I thought I had tried that already, but this time it seems to be working.