验证邮箱地址格式 Args: email: 邮箱地址 Returns: 是否有效
(email: str)
| 289 | |
| 290 | |
| 291 | def validate_email(email: str) -> bool: |
| 292 | """ |
| 293 | 验证邮箱地址格式 |
| 294 | |
| 295 | Args: |
| 296 | email: 邮箱地址 |
| 297 | |
| 298 | Returns: |
| 299 | 是否有效 |
| 300 | """ |
| 301 | pattern = r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$" |
| 302 | return bool(re.match(pattern, email)) |
| 303 | |
| 304 | |
| 305 | def validate_url(url: str) -> bool: |
nothing calls this directly
no outgoing calls
no test coverage detected