Spaces:
Sleeping
Sleeping
Download utils/validators.py from roshcheeku/student-admin: direct link, hf CLI and curl.
- Browser
- Download file 344 Bytes
-
https://huggingface.co/spaces/roshcheeku/student-admin/resolve/main/utils/validators.py
- Command line
-
hf download hf://spaces/roshcheeku/student-admin/utils/validators.py
-
curl -L -o validators.py https://huggingface.co/spaces/roshcheeku/student-admin/resolve/main/utils/validators.py
344 Bytes
| # utils/validators.py | |
| import re | |
| EMAIL_RE = re.compile(r"^[\w\.-]+@[\w\.-]+\.\w+$") | |
| PWD_RE = re.compile(r"^(?=.*[0-9])(?=.*[!@#$%^&*()_+\-=\[\]{};':\"\\|,.<>\/?]).{8,}$") | |
| def valid_email(email: str) -> bool: | |
| return EMAIL_RE.match(email) is not None | |
| def valid_password(password: str) -> bool: | |
| return PWD_RE.match(password) is not None | |