Basic conditions for password verification:
Input: R @ m @ _f0rtu9e $ Output: Valid Password Input: Rama_fortune $ Output: Invalid Password Explanation: Number is missing Input: Rama # fortu9e Output: Invalid Password Explanation: Must consist from _ or @ or $
Here we have used the re module which provides support for regular expressions in Python . Along with this the re.search () method returns False (if the first parameter is not found in the second parameter). This method is best for validating a regular expression rather than extracting data. We used re.search () to check if alphabets, numbers or special characters are correct. To check for spaces, we use "/ s" which is included in the regular expression module.