Regular expression (regex) for password checking

What is the correct regex

password to meet the following criteria:

  • Must include at least 1 lowercase letter.
  • Must include at least 1 uppercase letter.
  • Must include at least 1 number.
  • Must include at least 1 special character (only the following special characters are allowed:) !#%

  • You should NOT include any other characters, followed by A-Za-z0-9!#%

    (optional ;

  • Must be 8 to 32 characters long.

This is what I tried, but it doesn't work:



But it should be:



But Unihedron's solution is better anyway, just wanted to mention it for users who will read this question in the future. :)

Unihedron's solution (can also be found in his answer below, I copied it for myself, just in case it changes (updates it to a better version) in response):



I got the following regex




Thanks again to Unihedron and scamazin. Appreciated!


source to share

2 answers

Use this regex:



Here is the regex demo !

More details:



Check your possible passwords against this and see if they give the correct result

I am using regex:





All Articles