Extract verification code of 6 digits from the SMS.
(message: str)
| 44 | |
| 45 | |
| 46 | def extract_verification_code(message: str) -> str: |
| 47 | """ |
| 48 | Extract verification code of 6 digits from the SMS. |
| 49 | """ |
| 50 | pattern = re.compile(r'\b[0-9]{6}\b') |
| 51 | codes: List[str] = pattern.findall(message) |
| 52 | return codes[0] if codes else "" |
| 53 | |
| 54 | |
| 55 | @app.post("/") |
no outgoing calls
no test coverage detected