MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / validate_email

Function validate_email

src/core/utils.py:291–302  ·  view source on GitHub ↗

验证邮箱地址格式 Args: email: 邮箱地址 Returns: 是否有效

(email: str)

Source from the content-addressed store, hash-verified

289
290
291def 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
305def validate_url(url: str) -> bool:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected