Being new to Regex, I am working on a project that allows me to check if a password contains lowercase characters, uppercase and numerical ones. Here is the code:
text = "azeAZE123"
compilealpha = re.compile(r'[a-z]*')
compileAlpha = re.compile(r'[A-Z]*')
compilenum = re.compile(r'[0-9]*')
checkalpha = compilealpha.findall(text)
checkAlpha = compileAlpha.findall(text)
checknum = compilenum.findall(text)
print(checkAlpha)
print(checkalpha)
print(checknum)
What I do not understand is that I get an output like this one:
['', '', '', 'AZE', '', '', '', '']
['aze', '', '', '', '', '', '', '']
['', '', '', '', '', '', '123', '']
Could anyone explain to me what happened and what am I doing wrong please?