diff --git a/backend/utils/utils.py b/backend/utils/utils.py index f0fbc82..2098c68 100644 --- a/backend/utils/utils.py +++ b/backend/utils/utils.py @@ -3,6 +3,7 @@ import hashlib import random import os from PyPDF2 import PdfReader +import re FILE_NAME = 'manjil.pdf' FILE_PATH = os.path.join(os.getcwd(), FILE_NAME) @@ -24,4 +25,9 @@ def read_pdf_human_readable(file_path: str) -> list[str]: pdf_page_text_contents.append(text.strip()) return pdf_page_text_contents - +def is_valid_email(email): + pattern = r'^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$' + if re.match(pattern, email): + return True + else: + return False \ No newline at end of file