I have this code in python.
Actually i wanted to validate the password field at server side using python. i want password to be alphanumeric in nature and thats what i have done so far
def valid():
num = "[a-zA-Z0-9]"
pwd = "asdf67AA"
match = re.match(pwd, num)
if match:
return True
else:
return False
its always returning false . It does not hit the IF condition. whats that i am missing
You have miss placed the argument in method reverse it .
it will work.
But this also matched if you set symbol in your string.
so, i suggest you apply this things :
pwd =”test5456″
pwd.isalnum():
This method will only work for if your string contain string or digit.
if you want strongly want your password contain both numeric and string than this code will help you.
Note :This code strongly work for numeric & symbol
Regards,
Anil