From 9fb2fdd80fabd5a32b28a979e191229ac3dcce17 Mon Sep 17 00:00:00 2001 From: Cullen Watson Date: Thu, 28 Sep 2023 18:25:56 -0500 Subject: [PATCH] [fix] add utils.py --- src/jobspy/utils.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/jobspy/utils.py diff --git a/src/jobspy/utils.py b/src/jobspy/utils.py new file mode 100644 index 0000000..1d90987 --- /dev/null +++ b/src/jobspy/utils.py @@ -0,0 +1,9 @@ +import re +from typing import Optional + + +def extract_emails_from_text(text: str) -> Optional[list[str]]: + if not text: + return None + email_regex = re.compile(r"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}") + return email_regex.findall(text)