diff --git a/Course3/Lab4/validations.py b/Course3/Lab4/validations.py old mode 100644 new mode 100755 index b18de65a2e..72aa21f433 --- a/Course3/Lab4/validations.py +++ b/Course3/Lab4/validations.py @@ -16,9 +16,14 @@ def validate_user(username, minlen): if not re.match('^[a-z0-9._]*$', username): return False # Usernames can't begin with a number - if username[0].isnumeric(): + if re.match("^[0-9._]", username): return False return True +print(validate_user("blue_kale", 3)) # True +print(validate_user(".blue.kale", 3)) # Currently True, should be False +print(validate_user("red_quinoa", 3)) # True +print(validate_user("_red_quinoa", 3)) # Currently True, should be False +