cn hizki-larriz

This commit is contained in:
2023-04-04 11:02:56 +02:00
parent 6e24de0621
commit 3a0739b384
7 changed files with 14 additions and 10 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+7 -3
View File
@@ -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)))