[fix] add utils.py

pull/54/head
Cullen Watson 2023-09-28 18:25:56 -05:00
parent af07c1ecbd
commit 9fb2fdd80f
1 changed files with 9 additions and 0 deletions

9
src/jobspy/utils.py Normal file
View File

@ -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)