pls check the regex below
import re
passwords = ['aaa5aa', 'adsfgg', 'e42dsf425']
regex = r'\w{3}\d{1}\w{2}'
for p in passwords:
if re.findall(regex, p):
print(p)
I dont uderstand why this regex match both: aaa5aa
and e42dsf425
. I expected to see only aaa5aa
as we have \d{1}
in the pattern.
Thank you very much, have a nice day!
Paweł