forms
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+16
-1
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import sqlite3
|
||||
import re
|
||||
|
||||
class Tools():
|
||||
|
||||
@@ -22,4 +23,18 @@ class Tools():
|
||||
cur = con.cursor()
|
||||
|
||||
cur.execute('''UPDATE codes SET valid=? WHERE code==?''',(0, code))
|
||||
con.commit()
|
||||
con.commit()
|
||||
|
||||
#forms validation
|
||||
|
||||
def input_validation(self, e):
|
||||
regex = r'^\w+$'
|
||||
return(bool(re.fullmatch(regex, e)))
|
||||
|
||||
def email_validation(self, e):
|
||||
regex = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b'
|
||||
return(bool(re.fullmatch(regex, e)))
|
||||
|
||||
def pwd_validation(self, e):
|
||||
regex = r'^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!#%*?&]{8,18}$'
|
||||
return(bool(re.fullmatch(regex, e)))
|
||||
Reference in New Issue
Block a user