what is wrong here?
import re
pattern = re.compile ('^\w@#$%{8,}')
password = '12345abcd@#$%'
x = pattern.search(password)
print (x)
print (len(password))
>Solution :
You didn’t escape the $ which has a special meaning in a regular expression and didn’t put the allowed characters in square brackets to allow any of them.
This: ^[\w@#\$%]{8,} is the modified version of the regex which matches the password.
I suggest you check your regular expressions here: https://regex101.com/r/ldvJLf/1 . This site explains in detail the meaning of all single elements of the regular expression, so you can directly see what is wrong if things doesn’t work as you expected.