Spaces:
Sleeping
Sleeping
| import re | |
| def extract_phone(text: str) -> str | None: | |
| if not text: | |
| return None | |
| m = re.search(r"(\+?\d[\d\-\s]{8,}\d)", text) | |
| return m.group(1).replace(" ", "") if m else None | |
| def looks_valid(phone: str | None) -> bool: | |
| if not phone: return False | |
| digits = "".join(ch for ch in phone if ch.isdigit()) | |
| return len(digits) >= 10 |