Jun-11-2024, 08:46 AM
(Jun-09-2024, 02:40 PM)Pedroski55 Wrote: Something like this?
un = input('Enter your username like this Schweinehund: Firstname.Lastname ') a = un.split('.') b = re.compile(a[0]) c = re.compile(a[1]) np = input('Enter your password Schweinehund! ') while not b.search(np) == None: np = input('Enter your password again Schweinehund, but don\'t use your first name in the password! ') while not c.search(np) == None: np = input('Enter your password again Schweinehund, but don\'t use your last name in the password! ')
Output:un 'Pedro.Rodriguez'While loops
Output:np pedro.RODRIGUEZ
Jawohl!
Output:Enter your password again Schweinehund, but don't use your first name in the password! prodriguez Enter your password again Schweinehund, but don't use your last name in the password! pedror Enter your password again Schweinehund, but don't use your first name in the password! PeterR
If you want to ignore case add: re.IGNORECASE to the regexes
I don't think names will contain characters that need re.escape, but maybe you need to think about that if you have names like O'Keefe or O'Reilly.
And, you also need to re the name to make sure it suits!
thanks Pedro
cant i already use the "un" class variable to capture there username and do a split on that ?
and what about if lets say they have a double barrel username ie robert.de.niro depending how many deliminators there are i want to capture all variables