cn hizki-larriz
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+7
-3
@@ -27,8 +27,12 @@ class Tools():
|
||||
|
||||
#form validation
|
||||
|
||||
def input_validation(self, e):
|
||||
regex = r'^\w+$'
|
||||
def input_validation(self, e, ws=None):
|
||||
if ws:
|
||||
#accepts whitespaces
|
||||
regex = r'^\w+( \w+)*$'
|
||||
else:
|
||||
regex = r'^\w+$'
|
||||
return(bool(re.fullmatch(regex, e)))
|
||||
|
||||
def email_validation(self, e):
|
||||
@@ -37,4 +41,4 @@ class Tools():
|
||||
|
||||
def pwd_validation(self, e):
|
||||
regex = r'^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!#%*?&]{8,18}$'
|
||||
return(bool(re.fullmatch(regex, e)))
|
||||
return(bool(re.fullmatch(regex, e)))
|
||||
|
||||
Reference in New Issue
Block a user